facebookresearch / kill-the-bits

Code for: "And the bit goes down: Revisiting the quantization of neural networks"
Other
636 stars 123 forks source link

I can't run python inference.py --model maskrcnn_resnet50_fpn --state-dict-compressed models/compressed/mask_r_cnn.pth --device cuda --data-path YOUR_COCO_PATH #15

Closed mainguyenanhvu closed 5 years ago

mainguyenanhvu commented 5 years ago

I have downloaded and run follow the readme. But when running python inference.py --model maskrcnn_resnet50_fpn --state-dict-compressed models/compressed/mask_r_cnn.pth --device cuda --data-path YOUR_COCO_PATH (actually I replaced YOUR_COCO_PATH), it thrown me an error:

usage: inference.py [-h] [--model {resnet18,resnet50,resnet50_semisup}] [--state-dict-compressed STATE_DICT_COMPRESSED] [--device {cpu,cuda}] [--data-path DATA_PATH] [--batch-size BATCH_SIZE] [--n-workers N_WORKERS] inference.py: error: argument --model: invalid choice: 'maskrcnn_resnet50_fpn' (choose from 'resnet18', 'resnet50', 'resnet50_semisup')

I try to insert 'maskrcnn_resnet50_fpn' in model but it still does not run.

Please, help me to solve it.

Thanks a lot.

pierrestock commented 5 years ago

Hello mainguyenanhvu,

Thanks for reaching out! Did you run git checkout mask_r_cnn (i.e., are you in the right branch of the repo?

Pierre

mainguyenanhvu commented 5 years ago

It showed me: fatal: not a git repository (or any parent up to mount point /user) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

pierrestock commented 5 years ago

Alright, seems you're not in the right repository. Could you start over with the following commands:

pierrestock commented 5 years ago

Yes, the file mask_r_cnn.pth is present in both branches. The file to perform inference on this compressed model is only present in the branch mask_r_cnn of the repo. Moreover, maskrcnn_resnet50_fpn refers to the architecture file present in PyTorch, not to the compressed weights.

So I do think this problem is related to git. Please follow the instructions above and let me know.

mainguyenanhvu commented 5 years ago

Thanks a lot @pierrestock. It run well.