cedrickchee / realtime-detectron

Real-time Detectron using webcam.
41 stars 8 forks source link

no arguments supplied to model = infer_engine.initialize_model_from_cfg() #1

Open bmabir17 opened 6 years ago

bmabir17 commented 6 years ago

On line 103 in inference.py the weights arguments are not inserted. The correct line should be model = infer_engine.initialize_model_from_cfg(args.weights)

Edit: After giving the weights file the following error occurs ' Traceback (most recent call last): File "tools/inference.py", line 160, in main(args) File "tools/inference.py", line 103, in main model = infer_engine.initialize_model_from_cfg(args.weights) File "/detectron/detectron/core/test_engine.py", line 328, in initialize_model_from_cfg model = model_builder.create(cfg.MODEL.TYPE, train=False, gpu_id=gpu_id) File "/detectron/detectron/modeling/model_builder.py", line 120, in create init_params=train File "/detectron/detectron/modeling/detector.py", line 49, in init assert self.num_classes > 0, 'num_classes must be > 0' AssertionError: num_classes must be > 0 ' I am using the docker image of the detectron. And was able to run the demo of infer_simple.py on a picture. so i think the detectron setup is not a problem.

ganliqiang commented 5 years ago

i have the same problem do you have fixed it ?