language-table icon indicating copy to clipboard operation
language-table copied to clipboard

import errors

Open sagadre opened this issue 1 year ago • 5 comments

Hi all, thanks for the code release! I followed to instructions for installing dependencies via requirements_static.txt. I then tried from language_table.environments.oracles import push_oracle_rrt_slowdown and got the following error:

Traceback (most recent call last):
  File "tmp.py", line 1, in <module>
    from language_table.environments.oracles import push_oracle_rrt_slowdown
  File "/local/vondrick/sy/repos/language-table/language_table/environments/oracles/push_oracle_rrt_slowdown.py", line 23, in <module>
    from language_table.environments.oracles import oriented_push_oracle
  File "/local/vondrick/sy/repos/language-table/language_table/environments/oracles/oriented_push_oracle.py", line 22, in <module>
    from tf_agents.policies import py_policy
  File "/local/vondrick/sy/miniconda3/envs/lt/lib/python3.8/site-packages/tf_agents/__init__.py", line 70, in <module>
    from tf_agents import agents
  File "/local/vondrick/sy/miniconda3/envs/lt/lib/python3.8/site-packages/tf_agents/agents/__init__.py", line 17, in <module>
    from tf_agents.agents import behavioral_cloning
  File "/local/vondrick/sy/miniconda3/envs/lt/lib/python3.8/site-packages/tf_agents/agents/behavioral_cloning/__init__.py", line 17, in <module>
    from tf_agents.agents.behavioral_cloning import behavioral_cloning_agent
  File "/local/vondrick/sy/miniconda3/envs/lt/lib/python3.8/site-packages/tf_agents/agents/behavioral_cloning/behavioral_cloning_agent.py", line 37, in <module>
    import tensorflow_probability as tfp
  File "/local/vondrick/sy/miniconda3/envs/lt/lib/python3.8/site-packages/tensorflow_probability/__init__.py", line 20, in <module>
    from tensorflow_probability import substrates
  File "/local/vondrick/sy/miniconda3/envs/lt/lib/python3.8/site-packages/tensorflow_probability/substrates/__init__.py", line 17, in <module>
    from tensorflow_probability.python.internal import all_util
  File "/local/vondrick/sy/miniconda3/envs/lt/lib/python3.8/site-packages/tensorflow_probability/python/__init__.py", line 138, in <module>
    dir(globals()[pkg_name])  # Forces loading the package from its lazy loader.
  File "/local/vondrick/sy/miniconda3/envs/lt/lib/python3.8/site-packages/tensorflow_probability/python/internal/lazy_loader.py", line 57, in __dir__
    module = self._load()
  File "/local/vondrick/sy/miniconda3/envs/lt/lib/python3.8/site-packages/tensorflow_probability/python/internal/lazy_loader.py", line 40, in _load
    module = importlib.import_module(self.__name__)
  File "/local/vondrick/sy/miniconda3/envs/lt/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/local/vondrick/sy/miniconda3/envs/lt/lib/python3.8/site-packages/tensorflow_probability/python/experimental/__init__.py", line 31, in <module>
    from tensorflow_probability.python.experimental import bijectors
  File "/local/vondrick/sy/miniconda3/envs/lt/lib/python3.8/site-packages/tensorflow_probability/python/experimental/bijectors/__init__.py", line 17, in <module>
    from tensorflow_probability.python.bijectors.ldj_ratio import forward_log_det_jacobian_ratio
  File "/local/vondrick/sy/miniconda3/envs/lt/lib/python3.8/site-packages/tensorflow_probability/python/bijectors/__init__.py", line 19, in <module>
    from tensorflow_probability.python.bijectors.absolute_value import AbsoluteValue
  File "/local/vondrick/sy/miniconda3/envs/lt/lib/python3.8/site-packages/tensorflow_probability/python/bijectors/absolute_value.py", line 19, in <module>
    from tensorflow_probability.python.bijectors import bijector
  File "/local/vondrick/sy/miniconda3/envs/lt/lib/python3.8/site-packages/tensorflow_probability/python/bijectors/bijector.py", line 26, in <module>
    from tensorflow_probability.python.internal import batch_shape_lib
  File "/local/vondrick/sy/miniconda3/envs/lt/lib/python3.8/site-packages/tensorflow_probability/python/internal/batch_shape_lib.py", line 23, in <module>
    from tensorflow_probability.python.internal import prefer_static as ps
  File "/local/vondrick/sy/miniconda3/envs/lt/lib/python3.8/site-packages/tensorflow_probability/python/internal/prefer_static.py", line 421, in <module>
    size = _copy_docstring(tf.size, _size)
  File "/local/vondrick/sy/miniconda3/envs/lt/lib/python3.8/site-packages/tensorflow_probability/python/internal/prefer_static.py", line 91, in _copy_docstring
    raise ValueError(
ValueError: Arg specs do not match: original=FullArgSpec(args=['input', 'out_type', 'name'], varargs=None, varkw=None, defaults=(None, None), kwonlyargs=[], kwonlydefaults=None, annotations={}), new=FullArgSpec(args=['input', 'out_type', 'name'], varargs=None, varkw=None, defaults=(tf.int32, None), kwonlyargs=[], kwonlydefaults=None, annotations={}), fn=<function size_v2 at 0x7faca63d9820>

Not super familiar with the tf_agents library, any idea what could be up?

sagadre avatar Jun 09 '23 18:06 sagadre

hi bro, I got the same error!!!!!! have you solved this issue yet ?

KarelZhang avatar Jun 16 '23 09:06 KarelZhang

For my use case I realized that I did not need tf_agents, so I ended up re-writing parts of the codebase to remove this dependency.

It might be the case that the requirements.txt is not compatible with the repo. Maybe @ayzaan can comment and potentially update the install instructions if this is the case? Thanks in advance and sorry for the trouble!

sagadre avatar Jun 16 '23 16:06 sagadre

thank you bro @sagadre by the way, how did you get tf-nightly==2.12? I check the (https://pypi.python.org/pypi/tf-nightly),the oldest version is 2.13

KarelZhang avatar Jun 19 '23 02:06 KarelZhang

@KarelZhang I think you can simply get tensorflow 2.12 since the nightly version is just an early release of it and the regular tensorflow 2.12 is available now.

@sagadre Did you get training and evaluation to run? I installed mostly newer versions of the dependencies and got the training to run on gpu but evaluation doesn't work at all.

When trying to install requirements_static.txt however I have another problem right now... to run on GPU I need jax[cuda] which only works with cudnn82 or cudnn86 however the repo also contains torch 1.13.1 which needs cudnn85... So I can't run on GPU... how did you solve this?

Could you maybe create a public repo with your changes?

felixmin avatar Jun 19 '23 21:06 felixmin

Hey everyone, sorry for the dependency issues.

Looks like there are issues both with python upgrade from 3.10 -> 3.11, and with some pypi versions being unavailable. I'll update the instructions to use miniconda and fix the python version to 3.10 for now.

Here is a config I got to work:

Install miniconda: https://docs.conda.io/en/latest/miniconda.html

conda create -n lt_train python=3.10
conda activate lt_train

change tf-nightly==2.12.0.dev20230203 to tensorflow==2.12.0 like @felixmin suggested. pip install --no-deps -r ./requirements_static.txt

This allowed me to run both the examples scripts, as well as train/eval. I haven't tried running anything on GPU but maybe others can chime in here.

Hopefully this helps for now, I'll work on an updated version of the readme with a more robust install procedure.

ayzaan avatar Jun 19 '23 23:06 ayzaan