Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'object_detection' #56

Open
Airyzf opened this issue Oct 24, 2018 · 6 comments
Open

No module named 'object_detection' #56

Airyzf opened this issue Oct 24, 2018 · 6 comments

Comments

@Airyzf
Copy link

Airyzf commented Oct 24, 2018

Hi, I got an error when running "python run_stream.py",

Traceback (most recent call last):
File "run_stream.py", line 125, in main
from lib.detection_trt_v1 import TRTV1
File "/home/nvidia/Downloads/realtime_object_detection-master/lib/detection_trt_v1.py", line 4, in
from lib.load_graph_trt_v1 import LoadFrozenGraph
File "/home/nvidia/Downloads/realtime_object_detection-master/lib/load_graph_trt_v1.py", line 10, in
from tf_trt_models.detection import download_detection_model
File "/home/nvidia/Downloads/realtime_object_detection-master/tf_trt_models/detection.py", line 5, in
from object_detection.protos.pipeline_pb2 import TrainEvalPipelineConfig
ImportError: No module named 'object_detection'

I downloaded the object_detection from https://github.com/tensorflow/models and put it to the same directory as the "detection.py",but it didn't work .

@naisy
Copy link
Owner

naisy commented Oct 24, 2018

Hi @Airyzf,

trt_v1 needs https://github.com/NVIDIA-Jetson/tf_trt_models

And when using PC, you need TensorRT and trt enabled tensorflow (1.8 or later).
Jetson Xavier/TX2, TensorRT is already installed. So you need trt enabled tensorflow (1.8 or later).

@Airyzf
Copy link
Author

Airyzf commented Oct 25, 2018

Hi @Airyzf,

trt_v1 needs https://github.com/NVIDIA-Jetson/tf_trt_models

And when using PC, you need TensorRT and trt enabled tensorflow (1.8 or later).
Jetson Xavier/TX2, TensorRT is already installed. So you need trt enabled tensorflow (1.8 or later).

thank you, it work when the config.yml is nms_v2,
model_type: 'nms_v2'
model_path: 'models/ssd_mobilenet_v1_coco_2018_01_28/frozen_inference_graph.pb'

but dont work trt_v1 , here is my execution step

  1. I download https://github.com/NVIDIA-Jetson/tf_trt_models and replace the folder realtime_object_detection/tf_trt_models
  2. run the five steps in tf_trt_models Setup
  3. download the object_detection from https://github.com/tensorflow/models and put it to realtime_object_detection/tf_trt_models /object_detection
  4. edit config.yml
    model_type: 'trt_v1'
    precision_model: 'FP32' # 'FP32', 'FP16', 'INT8'
    model: 'ssdlite_mobilenet_v2_coco_2018_05_09'
  5. run "python run_stream.py"

@naisy
Copy link
Owner

naisy commented Oct 25, 2018

Hi, @Airyzf,

OK, I understood.

  1. mkdir ~/github; cd ~/github # base directory. Any directory is OK.
  2. git clone https://github.com/naisy/realtime_object_detection
  3. git clone https://github.com/NVIDIA-Jetson/tf_trt_models # download to ~/github/tf_trt_models
  4. Install tf_trt_models. # When you run install.sh, preparation for https://github.com/tensorflow/models is completed.
  5. edit config.yml # Yes, your config.yml
  6. run "python run_stream.py" # Yes, your command

ImportError: No module named 'object_detection'

It is installed by tf_trt_models.

@Airyzf
Copy link
Author

Airyzf commented Oct 25, 2018

Hi, @Airyzf,

OK, I understood.

  1. mkdir ~/github; cd ~/github # base directory. Any directory is OK.
  2. git clone https://github.com/naisy/realtime_object_detection
  3. git clone https://github.com/NVIDIA-Jetson/tf_trt_models # download to ~/github/tf_trt_models
  4. Install tf_trt_models. # When you run install.sh, preparation for https://github.com/tensorflow/models is completed.
  5. edit config.yml # Yes, your config.yml
  6. run "python run_stream.py" # Yes, your command

ImportError: No module named 'object_detection'

It is installed by tf_trt_models.

thanks, there is no errors about 'object_detection' , but i got an other error.

Traceback (most recent call last):
File "/home/nvidia/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1292, in _do_call
return fn(*args)
File "/home/nvidia/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1277, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/home/nvidia/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1367, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [3,3,576,273] rhs shape= [1,1,576,273]
[[{{node save/Assign_3}} = Assign[T=DT_FLOAT, _class=["loc:@BoxPredictor_0/ClassPredictor/weights"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:GPU:0"](BoxPredictor_0/ClassPredictor/weights, save/RestoreV2/_7)]]
[[{{node save/RestoreV2/_16}} = _SendT=DT_FLOAT, client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_22_save/RestoreV2", _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

@naisy
Copy link
Owner

naisy commented Oct 25, 2018

Hi @Airyzf,

I cannot check that problem. Because it does not occur in my environment.
The errors seems to related to restore from checkpoint in tf_trt_modes.
tf_trt_models rebuilds the model from the checkpoint. It seems to be an error at that time.

Please check whether tf_trt_models examples can be executed.

@Airyzf
Copy link
Author

Airyzf commented Oct 25, 2018

Hi @Airyzf,

I cannot check that problem. Because it does not occur in my environment.
The errors seems to related to restore from checkpoint in tf_trt_modes.
tf_trt_models rebuilds the model from the checkpoint. It seems to be an error at that time.

Please check whether tf_trt_models examples can be executed.

ok, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants