Open traversaro opened 1 year ago
Do you mind trying install tensor2robot following the instruction in https://github.com/google-research/tensor2robot#tensor2robot and then install this repo? (maybe comment out the tensor2robot dependency).
Thanks
I tried, using a venv on Ubuntu 22.04 with Python 3.10, and cloing this repo and https://github.com/google-research/tensor2robot in a directory named ~/ws
. I have the following failures:
The protoc
command:
(venv) traversaro@IITICUBLAP257:~/ws/tensor2robot/proto$ protoc -I=./ --python_out=`pwd` tensor2robot/t2r.proto
Could not make proto path relative: tensor2robot/t2r.proto: No such file or directory
Indeed, in ~/ws/tensor2robot/proto
there is only a t2r.proto
file, not a tensor2robot/t2r.proto
.
Changing the command to protoc -I=./ --python_out=
pwdt2r.proto
. However, it is worth noting that the protoc used is the one of the system, that is not the same version installed pip, i.e.:
(venv) traversaro@IITICUBLAP257:~/ws/tensor2robot/proto$ which protoc
/usr/bin/protoc
(venv) traversaro@IITICUBLAP257:~/ws/tensor2robot/proto$ protoc --version
libprotoc 3.12.4
(venv) traversaro@IITICUBLAP257:~/ws/tensor2robot/proto$ pip list --verbose | grep proto
protobuf 3.19.6 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
After this, the command python -m tensor2robot.research.pose_env.pose_env_models_test
fails:
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/traversaro/ws/tensor2robot/research/pose_env/pose_env_models_test.py", line 23, in <module>
from tensor2robot.input_generators import default_input_generator
File "/home/traversaro/ws/tensor2robot/input_generators/__init__.py", line 17, in <module>
from tensor2robot.input_generators import abstract_input_generator
File "/home/traversaro/ws/tensor2robot/input_generators/abstract_input_generator.py", line 25, in <module>
from tensor2robot.models import abstract_model
File "/home/traversaro/ws/tensor2robot/models/abstract_model.py", line 28, in <module>
from tensor2robot.models import model_interface
File "/home/traversaro/ws/tensor2robot/models/model_interface.py", line 33, in <module>
from tensor2robot.preprocessors import abstract_preprocessor
File "/home/traversaro/ws/tensor2robot/preprocessors/__init__.py", line 17, in <module>
from tensor2robot.preprocessors import abstract_preprocessor
File "/home/traversaro/ws/tensor2robot/preprocessors/abstract_preprocessor.py", line 22, in <module>
from tensor2robot.utils import tensorspec_utils
File "/home/traversaro/ws/tensor2robot/utils/tensorspec_utils.py", line 31, in <module>
from tensorflow.contrib import framework as contrib_framework
ModuleNotFoundError: No module named 'tensorflow.contrib'
(venv) traversaro@IITICUBLAP257:~/ws$ python -m tensor2robot.research.pose_env.pose_env_models_test
Perhaps tensorflow 1.x is required?
If I ignore the previous command failure and I go ahead and install the requirements of the robotics_transformer
repo, the error is similar:
File "/usr/lib/python3.10/runpy.py", line 187, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.10/runpy.py", line 110, in _get_module_details
__import__(pkg_name)
File "/home/traversaro/ws/robotics_transformer/tokenizers/action_tokenizer.py", line 35, in <module>
from tensor2robot.utils import tensorspec_utils
File "/home/traversaro/ws/tensor2robot/utils/tensorspec_utils.py", line 31, in <module>
from tensorflow.contrib import framework as contrib_framework
ModuleNotFoundError: No module named 'tensorflow.contrib'
For reproducibility, my pip list
is:
(venv) traversaro@IITICUBLAP257:~/ws$ pip list --verbose
Package Version Location Installer
---------------------------- --------- ----------------------------------------------------- ---------
absl-py 1.3.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
astunparse 1.6.3 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
cachetools 5.2.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
certifi 2022.12.7 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
charset-normalizer 2.1.1 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
cloudpickle 2.2.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
decorator 5.1.1 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
dm-tree 0.1.7 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
flatbuffers 22.12.6 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
gast 0.4.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
gin-config 0.5.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
google-auth 2.15.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
google-auth-oauthlib 0.4.6 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
google-pasta 0.2.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
grpcio 1.51.1 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
gym 0.23.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
gym-notices 0.0.8 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
h5py 3.7.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
idna 3.4 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
keras 2.11.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
libclang 14.0.6 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
Markdown 3.4.1 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
MarkupSafe 2.1.1 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
numpy 1.23.5 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
oauthlib 3.2.2 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
opt-einsum 3.3.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
packaging 22.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
Pillow 5.3.0 /home/traversaro/ws/venv/lib/python3.10/site-packages
pip 22.0.2 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
protobuf 3.19.6 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
pyasn1 0.4.8 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
pyasn1-modules 0.2.8 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
pybullet 2.5.0 /home/traversaro/ws/venv/lib/python3.10/site-packages
pygame 2.1.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
requests 2.28.1 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
requests-oauthlib 1.3.1 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
rsa 4.9 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
setuptools 59.6.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
six 1.16.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
tensorboard 2.11.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
tensorboard-data-server 0.6.1 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
tensorboard-plugin-wit 1.8.1 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
tensorflow 2.11.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
tensorflow-estimator 2.11.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
tensorflow-io-gcs-filesystem 0.28.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
tensorflow-probability 0.19.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
tensorflow-serving-api 2.11.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
termcolor 2.1.1 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
tf-agents 0.15.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
tf-slim 1.1.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
typing_extensions 4.4.0 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
urllib3 1.26.13 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
Werkzeug 2.2.2 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
wheel 0.38.4 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
wrapt 1.14.1 /home/traversaro/ws/venv/lib/python3.10/site-packages pip
I also installed a dedicated Python 3.7 to be able to install a Tensorflow 1.* from PyPI, but even in that case the test fail, even if with a different error:
(robtranpy37) traversaro@IITICUBLAP257:~/ws$ python -m robotics_transformer.tokenizers.action_tokenizer.test
Traceback (most recent call last):
File "/home/traversaro/mambaforge/envs/robtranpy37/lib/python3.7/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/home/traversaro/mambaforge/envs/robtranpy37/lib/python3.7/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/home/traversaro/ws/robotics_transformer/tokenizers/action_tokenizer.py", line 39, in <module>
class RT1ActionTokenizer:
File "/home/traversaro/ws/robotics_transformer/tokenizers/action_tokenizer.py", line 45, in RT1ActionTokenizer
action_order: Optional[list[str]] = None):
TypeError: 'type' object is not subscriptable
Environment for reproducibility:
I am also getting a similar error on Python 3.8 as posted by @traversaro. Thanks for the suggestion @fxia22 , will try to install tensor2robot first.
Ubuntu 20.04.5 LTS Python 3.8.10
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Hi, don't know if you have solved the problem now, I tried to install tensor2robot and robotics_transformer separately on Python3.7 with Tensorflow 1.14, but it still has an error. It imported tensorflow_probability somewhere in the model, which means it requires Tensorflow version >= 2.11. That's a conflict.
@traversaro may I ask if you could solve your problem? I am getting the exact errors as you on both tf2 and tf1.15
Hi, have u solved this problem? I also get the same error "TypeError: 'type' object is not subscriptable "
@traversaro may I ask if you could solve your problem? I am getting the exact errors as you on both tf2 and tf1.15
No, I was not able to solve the problem. I suspect the code in this repo is actually a mixture of of some code that was meant to work with tensorflow1 and some other code that was meant to work with tensorflow2, but I never investigated further.
Hi, I tried to install your software by following the guidelines in the README and I also encountered issues when running pip install -r robotics_transformer/requirements.txt
:
Collecting git+https://github.com/google-research/tensor2robot#tensor2robot (from -r robotics_transformer/requirements.txt (line 9))
Cloning https://github.com/google-research/tensor2robot to /tmp/pip-req-build-bizawiii
Running command git clone -q https://github.com/google-research/tensor2robot /tmp/pip-req-build-bizawiii
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-bizawiii/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-bizawiii/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-req-build-bizawiii/pip-egg-info
cwd: /tmp/pip-req-build-bizawiii/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.8/tokenize.py", line 392, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-bizawiii/setup.py'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Therefore, I tried to install tensor2robot
separately as suggested in https://github.com/google-research/robotics_transformer/issues/1#issuecomment-1349580393 and:
by updating the github link of the repo in the first command (the one in the documentation is not updated), I was able to run python -m tensor2robot.research.pose_env.pose_env_test
successfully
by updating the file path in protoc -I=./ --python_out='pwd' tensor2robot/t2r.proto
as in https://github.com/google-research/robotics_transformer/issues/1#issuecomment-1349900556, I get the very same error of https://github.com/google-research/robotics_transformer/issues/1#issuecomment-1349900556 when running python -m tensor2robot.research.pose_env.pose_env_models_test
:
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/pviceconte/git/tensor2robot/research/pose_env/pose_env_models_test.py", line 23, in <module>
from tensor2robot.input_generators import default_input_generator
File "/home/pviceconte/git/tensor2robot/input_generators/__init__.py", line 17, in <module>
from tensor2robot.input_generators import abstract_input_generator
File "/home/pviceconte/git/tensor2robot/input_generators/abstract_input_generator.py", line 25, in <module>
from tensor2robot.models import abstract_model
File "/home/pviceconte/git/tensor2robot/models/abstract_model.py", line 28, in <module>
from tensor2robot.models import model_interface
File "/home/pviceconte/git/tensor2robot/models/model_interface.py", line 33, in <module>
from tensor2robot.preprocessors import abstract_preprocessor
File "/home/pviceconte/git/tensor2robot/preprocessors/__init__.py", line 17, in <module>
from tensor2robot.preprocessors import abstract_preprocessor
File "/home/pviceconte/git/tensor2robot/preprocessors/abstract_preprocessor.py", line 22, in <module>
from tensor2robot.utils import tensorspec_utils
File "/home/pviceconte/git/tensor2robot/utils/tensorspec_utils.py", line 31, in <module>
from tensorflow.contrib import framework as contrib_framework
ModuleNotFoundError: No module named 'tensorflow.contrib'
For further context, I am using Python 3.8 on Ubuntu 20.04, and here you have my pip list --verbose
output:
I am also getting a similar error on Python 3.8 as posted by @traversaro, has anyone solved it successfully?
Collecting git+https://github.com/google-research/tensor2robot#tensor2robot (from -r robotics_transformer/requirements.txt (line 9))
Cloning https://github.com/google-research/tensor2robot to /tmp/pip-req-build-q4u7a7wr
Running command git clone --filter=blob:none --quiet https://github.com/google-research/tensor2robot /tmp/pip-req-build-q4u7a7wr
Resolved https://github.com/google-research/tensor2robot to commit f93f378db3183cceaad1b96828b199cf40cad606
ERROR: git+https://github.com/google-research/tensor2robot#tensor2robot (from -r robotics_transformer/requirements.txt (line 9)) does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.
Hi, I tried to install your software by following the guidelines in the README and I also encountered issues when running
pip install -r robotics_transformer/requirements.txt
:Collecting git+https://github.com/google-research/tensor2robot#tensor2robot (from -r robotics_transformer/requirements.txt (line 9)) Cloning https://github.com/google-research/tensor2robot to /tmp/pip-req-build-bizawiii Running command git clone -q https://github.com/google-research/tensor2robot /tmp/pip-req-build-bizawiii ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-bizawiii/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-bizawiii/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-req-build-bizawiii/pip-egg-info cwd: /tmp/pip-req-build-bizawiii/ Complete output (5 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python3.8/tokenize.py", line 392, in open buffer = _builtin_open(filename, 'rb') FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-bizawiii/setup.py' ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Therefore, I tried to install
tensor2robot
separately as suggested in #1 (comment) and:
- by updating the github link of the repo in the first command (the one in the documentation is not updated), I was able to run
python -m tensor2robot.research.pose_env.pose_env_test
successfully- by updating the file path in
protoc -I=./ --python_out='pwd' tensor2robot/t2r.proto
as in Error installing requirements.txt ( tensor2robot ) #1 (comment), I get the very same error of Error installing requirements.txt ( tensor2robot ) #1 (comment) when runningpython -m tensor2robot.research.pose_env.pose_env_models_test
:Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/pviceconte/git/tensor2robot/research/pose_env/pose_env_models_test.py", line 23, in <module> from tensor2robot.input_generators import default_input_generator File "/home/pviceconte/git/tensor2robot/input_generators/__init__.py", line 17, in <module> from tensor2robot.input_generators import abstract_input_generator File "/home/pviceconte/git/tensor2robot/input_generators/abstract_input_generator.py", line 25, in <module> from tensor2robot.models import abstract_model File "/home/pviceconte/git/tensor2robot/models/abstract_model.py", line 28, in <module> from tensor2robot.models import model_interface File "/home/pviceconte/git/tensor2robot/models/model_interface.py", line 33, in <module> from tensor2robot.preprocessors import abstract_preprocessor File "/home/pviceconte/git/tensor2robot/preprocessors/__init__.py", line 17, in <module> from tensor2robot.preprocessors import abstract_preprocessor File "/home/pviceconte/git/tensor2robot/preprocessors/abstract_preprocessor.py", line 22, in <module> from tensor2robot.utils import tensorspec_utils File "/home/pviceconte/git/tensor2robot/utils/tensorspec_utils.py", line 31, in <module> from tensorflow.contrib import framework as contrib_framework ModuleNotFoundError: No module named 'tensorflow.contrib'
For further context, I am using Python 3.8 on Ubuntu 20.04, and here you have my
pip list --verbose
output:
pip list --verbose
output
@paolo-viceconte Have you find the resolution later?
The tensorflow.contrib has been removed in tensorflow2.x. according to the following link https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md But, we can see that the framework is partly moved to core, so I just use tf instead of contrib_framework in tensorspec_utils.py, which I think can solve this problem @traversaro @LutaoChu
The tensorflow.contrib has been removed in tensorflow2.x. according to the following link https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md But, we can see that the framework is partly moved to core, so I just use tf instead of contrib_framework in tensorspec_utils.py, which I think can solve this problem @traversaro @LutaoChu
I fixed the problem in tensorspec_utils.py as you suggested, but ran into problems with tensorflow.contrib in other files such as optimizers.And I found a lot of modules that use tensorflow.contrib, one by one, to deal with the unreality.Do you have any good suggestions? @YiyangHuang-work
tensor2robot.research.pose_env.pose_env_models_test
2023-08-14 15:34:30.642314: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-08-14 15:34:30.675478: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-08-14 15:34:30.675765: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-08-14 15:34:31.338751: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
File "/home/lutaochu/miniconda3/envs/RT1/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/lutaochu/miniconda3/envs/RT1/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/lutaochu/code/tensor2robot/research/pose_env/pose_env_models_test.py", line 23, in <module>
from tensor2robot.input_generators import default_input_generator
File "/home/lutaochu/code/tensor2robot/input_generators/__init__.py", line 17, in <module>
from tensor2robot.input_generators import abstract_input_generator
File "/home/lutaochu/code/tensor2robot/input_generators/abstract_input_generator.py", line 25, in <module>
from tensor2robot.models import abstract_model
File "/home/lutaochu/code/tensor2robot/models/abstract_model.py", line 29, in <module>
from tensor2robot.models import optimizers
File "/home/lutaochu/code/tensor2robot/models/optimizers.py", line 23, in <module>
from tensorflow.contrib import opt as contrib_opt
ModuleNotFoundError: No module named 'tensorflow.contrib'
The tensorflow.contrib has been removed in tensorflow2.x. according to the following link https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md But, we can see that the framework is partly moved to core, so I just use tf instead of contrib_framework in tensorspec_utils.py, which I think can solve this problem @traversaro @LutaoChu
I fixed the problem in tensorspec_utils.py as you suggested, but ran into problems with tensorflow.contrib in other files such as optimizers.And I found a lot of modules that use tensorflow.contrib, one by one, to deal with the unreality.Do you have any good suggestions? @YiyangHuang-work
tensor2robot.research.pose_env.pose_env_models_test 2023-08-14 15:34:30.642314: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used. 2023-08-14 15:34:30.675478: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used. 2023-08-14 15:34:30.675765: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. 2023-08-14 15:34:31.338751: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT Traceback (most recent call last): File "/home/lutaochu/miniconda3/envs/RT1/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/home/lutaochu/miniconda3/envs/RT1/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/lutaochu/code/tensor2robot/research/pose_env/pose_env_models_test.py", line 23, in <module> from tensor2robot.input_generators import default_input_generator File "/home/lutaochu/code/tensor2robot/input_generators/__init__.py", line 17, in <module> from tensor2robot.input_generators import abstract_input_generator File "/home/lutaochu/code/tensor2robot/input_generators/abstract_input_generator.py", line 25, in <module> from tensor2robot.models import abstract_model File "/home/lutaochu/code/tensor2robot/models/abstract_model.py", line 29, in <module> from tensor2robot.models import optimizers File "/home/lutaochu/code/tensor2robot/models/optimizers.py", line 23, in <module> from tensorflow.contrib import opt as contrib_opt ModuleNotFoundError: No module named 'tensorflow.contrib'
The project just use this tensorspec_utils.py file,so there is no need to change others. I can run the code after fix this problem,wish you good luck~
conda create -n rt1
conda activate rt1
# install python3.11(Python 3.11.5)
conda install python
git clone https://github.com/google-research/tensor2robot.git
pybullet==2.5.0 --> pybullet
pip install -r tensor2robot/requirements.txt
python -m tensor2robot.research.pose_env.pose_env_test
contrib_framework --> tf
git clone https://github.com/google-research/robotics_transformer.git
# git+https://github.com/google-research/tensor2robot#tensor2robot
pip install -r robotics_transformer/requirements.txt
python -m robotics_transformer.tokenizers.action_tokenizer_test
Package Version
----------------------- ---------
absl-py 1.4.0
astunparse 1.6.3
cachetools 5.3.1
certifi 2023.7.22
charset-normalizer 3.2.0
cloudpickle 2.2.1
decorator 5.1.1
dm-tree 0.1.8
flatbuffers 23.5.26
gast 0.4.0
gin-config 0.5.0
google-auth 2.23.0
google-auth-oauthlib 1.0.0
google-pasta 0.2.0
grpcio 1.58.0
gym 0.23.0
gym-notices 0.0.8
h5py 3.9.0
idna 3.4
keras 2.13.1
libclang 16.0.6
Markdown 3.4.4
MarkupSafe 2.1.3
numpy 1.24.3
oauthlib 3.2.2
opt-einsum 3.3.0
packaging 23.1
Pillow 5.3.0
pip 23.2.1
protobuf 4.24.3
pyasn1 0.5.0
pyasn1-modules 0.3.0
pybullet 3.2.5
pygame 2.1.3
requests 2.31.0
requests-oauthlib 1.3.1
rsa 4.9
setuptools 68.0.0
six 1.16.0
tensorboard 2.13.0
tensorboard-data-server 0.7.1
tensorflow 2.13.0
tensorflow-estimator 2.13.0
tensorflow-macos 2.13.0
tensorflow-probability 0.20.1
tensorflow-serving-api 2.13.0
termcolor 2.3.0
tf-agents 0.17.0
tf-slim 1.1.0
typing_extensions 4.5.0
urllib3 1.26.16
Werkzeug 2.3.7
wheel 0.38.4
wrapt 1.15.0
I succeed in running action_tokenizer_test!!(py3.11.5+tf2.13.0)
Conda env
conda create -n rt1 conda activate rt1 # install python3.11(Python 3.11.5) conda install python
1.tensor2robot
1)git clone tensor2robot
git clone https://github.com/google-research/tensor2robot.git
2)modify tensor2robot/requirements.txt
pybullet==2.5.0 --> pybullet
3)pip install
pip install -r tensor2robot/requirements.txt
4)test
python -m tensor2robot.research.pose_env.pose_env_test
5)!!!!!modify tensor2robot/utils/tensorspec_utils.py
contrib_framework --> tf
2.rt1
1)git clone rt1
git clone https://github.com/google-research/robotics_transformer.git
2)Comment out the last line of robotics_transformer/requirements.txt
# git+https://github.com/google-research/tensor2robot#tensor2robot
3)pip install
pip install -r robotics_transformer/requirements.txt
4)test action tokenizer
python -m robotics_transformer.tokenizers.action_tokenizer_test
[Note]:my python3.11.5 pip list
Package Version ----------------------- --------- absl-py 1.4.0 astunparse 1.6.3 cachetools 5.3.1 certifi 2023.7.22 charset-normalizer 3.2.0 cloudpickle 2.2.1 decorator 5.1.1 dm-tree 0.1.8 flatbuffers 23.5.26 gast 0.4.0 gin-config 0.5.0 google-auth 2.23.0 google-auth-oauthlib 1.0.0 google-pasta 0.2.0 grpcio 1.58.0 gym 0.23.0 gym-notices 0.0.8 h5py 3.9.0 idna 3.4 keras 2.13.1 libclang 16.0.6 Markdown 3.4.4 MarkupSafe 2.1.3 numpy 1.24.3 oauthlib 3.2.2 opt-einsum 3.3.0 packaging 23.1 Pillow 5.3.0 pip 23.2.1 protobuf 4.24.3 pyasn1 0.5.0 pyasn1-modules 0.3.0 pybullet 3.2.5 pygame 2.1.3 requests 2.31.0 requests-oauthlib 1.3.1 rsa 4.9 setuptools 68.0.0 six 1.16.0 tensorboard 2.13.0 tensorboard-data-server 0.7.1 tensorflow 2.13.0 tensorflow-estimator 2.13.0 tensorflow-macos 2.13.0 tensorflow-probability 0.20.1 tensorflow-serving-api 2.13.0 termcolor 2.3.0 tf-agents 0.17.0 tf-slim 1.1.0 typing_extensions 4.5.0 urllib3 1.26.16 Werkzeug 2.3.7 wheel 0.38.4 wrapt 1.15.0
Hopefully it will be helpful to you guys!
# from tensorflow.contrib import framework as tf
pip install protobuf==3.20.1
cd tensor2robot/proto
protoc -I=./ --python_out=`pwd` t2r.proto
cd ..
cd ..
python -m robotics_transformer.tokenizers.action_tokenizer_test
However, I need pip install protobuf==3.20.3
and -bash: protoc: command not found, fixed by next blog:
https://grpc.io/docs/protoc-installation/
AttributeError: module 'keras._tf_keras.keras' has no attribute '__internal__'
FYI, I got this error and to resolve that, I installed pip install tf-keras-nightly
for tensorflow 2.16.1 and keras 3.1.1 integration.
AttributeError: module 'keras._tf_keras.keras' has no attribute '__internal__'
FYI, I got this error and to resolve that, I installedpip install tf-keras-nightly
for tensorflow 2.16.1 and keras 3.1.1 integration.
Still gives me AttributeError: module 'keras._tf_keras.keras' has no attribute '__internal__'
after pip install tf-keras-nightly
. However, continuously doing pip install tfp-nightly
and pip install tf-nightly
should be good. Source comes from https://github.com/tensorflow/probability/issues/1774#issuecomment-1979642276
I succeed in running action_tokenizer_test!!(py3.11.5+tf2.13.0)
Conda env
conda create -n rt1 conda activate rt1 # install python3.11(Python 3.11.5) conda install python
1.tensor2robot
1)git clone tensor2robot
git clone https://github.com/google-research/tensor2robot.git
2)modify tensor2robot/requirements.txt
pybullet==2.5.0 --> pybullet
3)pip install
pip install -r tensor2robot/requirements.txt
4)test
python -m tensor2robot.research.pose_env.pose_env_test
5)!!!!!modify tensor2robot/utils/tensorspec_utils.py
contrib_framework --> tf
2.rt1
1)git clone rt1
git clone https://github.com/google-research/robotics_transformer.git
2)Comment out the last line of robotics_transformer/requirements.txt
# git+https://github.com/google-research/tensor2robot#tensor2robot
3)pip install
pip install -r robotics_transformer/requirements.txt
4)test action tokenizer
python -m robotics_transformer.tokenizers.action_tokenizer_test
[Note]:my python3.11.5 pip list
Package Version ----------------------- --------- absl-py 1.4.0 astunparse 1.6.3 cachetools 5.3.1 certifi 2023.7.22 charset-normalizer 3.2.0 cloudpickle 2.2.1 decorator 5.1.1 dm-tree 0.1.8 flatbuffers 23.5.26 gast 0.4.0 gin-config 0.5.0 google-auth 2.23.0 google-auth-oauthlib 1.0.0 google-pasta 0.2.0 grpcio 1.58.0 gym 0.23.0 gym-notices 0.0.8 h5py 3.9.0 idna 3.4 keras 2.13.1 libclang 16.0.6 Markdown 3.4.4 MarkupSafe 2.1.3 numpy 1.24.3 oauthlib 3.2.2 opt-einsum 3.3.0 packaging 23.1 Pillow 5.3.0 pip 23.2.1 protobuf 4.24.3 pyasn1 0.5.0 pyasn1-modules 0.3.0 pybullet 3.2.5 pygame 2.1.3 requests 2.31.0 requests-oauthlib 1.3.1 rsa 4.9 setuptools 68.0.0 six 1.16.0 tensorboard 2.13.0 tensorboard-data-server 0.7.1 tensorflow 2.13.0 tensorflow-estimator 2.13.0 tensorflow-macos 2.13.0 tensorflow-probability 0.20.1 tensorflow-serving-api 2.13.0 termcolor 2.3.0 tf-agents 0.17.0 tf-slim 1.1.0 typing_extensions 4.5.0 urllib3 1.26.16 Werkzeug 2.3.7 wheel 0.38.4 wrapt 1.15.0
Hopefully it will be helpful to you guys!
I need to make some modifications to run the action_tokenizer_test.
1)Comment out the line 31 of tensor2robot/utils/tensorspec_utils.py
# from tensorflow.contrib import framework as tf
2)Downgrade the protobuf package to 3.20.1
pip install protobuf==3.20.1
3)Compile the protobufs
cd tensor2robot/proto protoc -I=./ --python_out=`pwd` t2r.proto
4)test action tokenizer
cd .. cd .. python -m robotics_transformer.tokenizers.action_tokenizer_test
Many thanks for your help!!! @TX-Leo
from tensorflow.python.util import nest
from tensorflow import TensorSpec as TSPEC
#nest = contrib_framework.nest
#TSPEC = contrib_framework.TensorSpec
Hello, thanks a lot for sharing the code related to this interesting research!
I tried to follow the instructions in the README, and I have problem in the
pip install -r robotics_transformer/requirements.txt
step. In particular, I tried with Python 3.11, 3.10, 3.8 and 3.6, and it is failing. Which version of Python should be used? Thanks a lot in advance.The errors are listed in the following.
Python 3.8
Python 3.10
Python 3.6