编译tensor2robot

GitHub - google-research/tensor2robot: Distributed machine learning infrastructure for large-scale robotics research

2.编译proto文件为python文件

robot@robot:~/ref$ mkdir protoc_3.3
robot@robot:~/ref$ cd protoc_3.3/
robot@robot:~/ref/protoc_3.3$ wget wget https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip

robot@robot:~/ref/protoc_3.3$  chmod 775 protoc-3.3.0-linux-x86_64.zip
robot@robot:~/ref/protoc_3.3$ unzip protoc-3.3.0-linux-x86_64.zip

编译robotics_transformer-LMLPHP

 (google_RT1) robot@robot:~/ref$ pip3 install protobuf==3.9.16

(google_RT1) robot@robot:~/ref/tensor2robot/proto$ ~/ref/protoc_3.3/bin/protoc t2r.proto --python_out=`pwd`

(google_RT1) robot@robot:~/ref/tensor2robot/proto$ ls
t2r_pb2.py  t2r.proto

可以看出成功编译出来了python文件

(google_RT1) robot@robot:~/ref$ python -m robotics_transformer.tokenizers.action_tokenizer.test
2022-12-16 10:54:58.365470: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2022-12-16 10:54:58.441400: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /opt/ros/kinetic/share/euslisp/jskeus/eus//Linux64/lib:/opt/ros/kinetic/lib:/opt/ros/kinetic/lib/x86_64-linux-gnu:/usr/local/cuda/lib64
2022-12-16 10:54:58.441420: I tensorflow/compiler/xla/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2022-12-16 10:54:58.822544: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /opt/ros/kinetic/share/euslisp/jskeus/eus//Linux64/lib:/opt/ros/kinetic/lib:/opt/ros/kinetic/lib/x86_64-linux-gnu:/usr/local/cuda/lib64
2022-12-16 10:54:58.822598: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /opt/ros/kinetic/share/euslisp/jskeus/eus//Linux64/lib:/opt/ros/kinetic/lib:/opt/ros/kinetic/lib/x86_64-linux-gnu:/usr/local/cuda/lib64
2022-12-16 10:54:58.822606: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
Traceback (most recent call last):
  File "/home/robot/anaconda3/envs/google_RT1/lib/python3.8/runpy.py", line 185, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/home/robot/anaconda3/envs/google_RT1/lib/python3.8/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "/home/robot/ref/robotics_transformer/tokenizers/action_tokenizer.py", line 35, in <module>
    from tensor2robot.utils import tensorspec_utils
  File "/home/robot/ref/tensor2robot/utils/tensorspec_utils.py", line 31, in <module>
    from tensorflow.contrib import framework as contrib_framework
ModuleNotFoundError: No module named 'tensorflow.contrib'
12-17 06:58