google-research / tensor2robot

Distributed machine learning infrastructure for large-scale robotics research
https://ai.google/research/teams/brain/robotics/
Apache License 2.0
537 stars 116 forks source link

cannot import name 't2r_pb2' from 'tensor2robot.proto' (unknown location) #4

Closed leeivan1007 closed 4 years ago

leeivan1007 commented 4 years ago

Python == 3.7.0 The environment is installed successfully with requirements.txt.

When I enter python -m tensor2robot.research.pose_env.pose_env_test it is successful

But when I enter this code, python -m tensor2robot.research.qtopt.t2r_models_test It output the error

Successfully opened dynamic library libnvinfer_plugin.so.6
Traceback (most recent call last):
  File "/home/ros/anaconda3/envs/tensor2robot/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/ros/anaconda3/envs/tensor2robot/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/ros/Work_ros/tensor2robot/research/qtopt/t2r_models_test.py", line 24, in <module>
    from tensor2robot.research.qtopt import t2r_models
  File "/home/ros/Work_ros/tensor2robot/research/qtopt/t2r_models.py", line 28, in <module>
    from tensor2robot.models import abstract_model
  File "/home/ros/Work_ros/tensor2robot/models/abstract_model.py", line 34, in <module>
    from tensor2robot.models import model_interface
  File "/home/ros/Work_ros/tensor2robot/models/model_interface.py", line 39, in <module>
    from tensor2robot.preprocessors import abstract_preprocessor
  File "/home/ros/Work_ros/tensor2robot/preprocessors/__init__.py", line 17, in <module>
    from tensor2robot.preprocessors import abstract_preprocessor
  File "/home/ros/Work_ros/tensor2robot/preprocessors/abstract_preprocessor.py", line 28, in <module>
    from tensor2robot.utils import tensorspec_utils
  File "/home/ros/Work_ros/tensor2robot/utils/tensorspec_utils.py", line 31, in <module>
    from tensor2robot.proto import t2r_pb2
ImportError: cannot import name 't2r_pb2' from 'tensor2robot.proto' (unknown location)

I can't find t2r_pb2 in the repository. any suggestion for help? think you!

ericjang commented 4 years ago

Hi Ivan,

You'll have to compile the https://github.com/google-research/tensor2robot/blob/master/proto/t2r.proto protocol buffer into the appropriate python library, and then import it.

See instructions here: https://developers.google.com/protocol-buffers/docs/reference/python-generated

leeivan1007 commented 4 years ago

Think you! It can run.