realtime-detectron icon indicating copy to clipboard operation
realtime-detectron copied to clipboard

no arguments supplied to model = infer_engine.initialize_model_from_cfg()

Open bmabir17 opened this issue 7 years ago • 1 comments

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.

bmabir17 avatar Aug 13 '18 11:08 bmabir17

i have the same problem do you have fixed it ?

ganliqiang avatar Dec 24 '18 03:12 ganliqiang