-
Notifications
You must be signed in to change notification settings - Fork 2.5k
add the option to use a FORCE_CUDA
to force cuda installation on docker
#612
Conversation
Following discussion [here](#167), this seemed the best solution
it is better to add |
You can keep it as a default set to true. Plus, the documentation in |
modified: setup.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@Bendidi can you also modify the instructions in |
@@ -38,7 +38,8 @@ docker run --rm -it \ | |||
-v /tmp/.X11-unix:/tmp/.X11-unix \ | |||
--device=/dev/video0:/dev/video0 \ | |||
--ipc=host maskrcnn-benchmark \ | |||
python demo/webcam.py --min-image-size 300 | |||
python demo/webcam.py --min-image-size 300 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this change necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes the default is ../configs/caffe2/e2e_mask_rcnn_R_50_FPN_1x_caffe2.yaml
, while when running from docker and from maskrcnn-benchmark
folder it should be configs/caffe2/e2e_mask_rcnn_R_50_FPN_1x_caffe2.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alright, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the demo won't work if you run it from maskrcnn-benchmark
folder due to the local includes, so this breaks in that case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for example, trying to import predictor
won't work if done from maskrcnn-benchmark
, and it is explicitly mentioned in the readme that you should cd to demo
first, so I'd vote for removing this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current command in the README.md
of the demo doesn't work:
docker run --rm -it \
-e DISPLAY=${DISPLAY} \
--privileged \
-v /tmp/.X11-unix:/tmp/.X11-unix \
--device=/dev/video0:/dev/video0 \
--ipc=host maskrcnn-benchmark \
python demo/webcam.py --min-image-size 300
throws the error FileNotFoundError: [Errno 2] No such file or directory: '../configs/caffe2/e2e_mask_rcnn_R_50_FPN_1x_caffe2.yaml'
this change is just to specify the path to the config file in this particular case:
docker run --rm -it \
-e DISPLAY=${DISPLAY} \
--privileged \
-v /tmp/.X11-unix:/tmp/.X11-unix \
--device=/dev/video0:/dev/video0 \
--ipc=host maskrcnn-benchmark \
python demo/webcam.py --min-image-size 300 \
--config-file configs/caffe2/e2e_mask_rcnn_R_50_FPN_1x_caffe2.yaml
it should not break any imports in the demo folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that this is for the docker
example.
I have never tried using it with docker, but I know for sure that without docker running the webcam demo code from maskrcnn-benchmark
folder will not work, you need to be in the demo
folder.
But maybe some paths are setup differently in the dockerfile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wierd, works fine for me outside of demo
folder (not in docker) using python 3.6 :
python demo/webcam.py --min-image-size 300 --config-file configs/caffe2/e2e_mask_rcnn_R_50_FPN_1x_caffe2.yaml MODEL.DEVICE cpu
There are no modifications to be added to |
there are changes because there is a new build arg in the docker |
Okay by me, but @fmassa has to merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
…cker (facebookresearch#612) * add a FORCE_CUDA flag Following discussion [here](facebookresearch#167), this seemed the best solution * Update Dockerfile * Update setup.py * add FORCE_CUDA as an ARG * modified: docker/Dockerfile modified: setup.py * small fix to readme of demo * remove test print * keep ARG_CUDA * remove env value and use the one from ARG * keep same formatting as source * change proposed by @miguelvr * Update INSTALL.md
cf #167
this seems to be the best workaround