Open kgavrilyuk opened 5 years ago
I am having a very simal issue thou mine cant find roi_align._ext.crop_and_resize._crop_and_resize error below
ModuleNotFoundError: No module named 'roi_align._ext.crop_and_resize._crop_and_resize'
I solved this. For me, this was an issue of (due to loading my CUDA via a package) the CUDA_PATH in the install.sh file. In my case, I need to change it to "/usr/lib/nvidia-cuda-toolkit" but here is a link for finding when your system has placed your CUDA_PATH https://stackoverflow.com/questions/36279045/where-did-cuda-get-installed-in-my-computer Hope this helps
@PHDPeter Hello Peter, I am wondering where is the install.sh file. I can only find setup.py file and there is no CUDA_PATH variable.
Hi @mangoSteve Yes, I should have said I was working on the pytorch_0.4 branch. Looking over the up to date branch I could not find any CUDA_PATH variable. This might be something you will need to set before running? Here is the code from the install.sh file that deals with the CUDA_PATH.
CUDA_PATH=/usr/local/cuda
echo "Compiling crop_and_resize kernels by nvcc..." cd roi_align/src/cuda $CUDA_PATH/bin/nvcc -c -o crop_and_resize_kernel.cu.o crop_and_resize_kernel.cu -x cu -Xcompiler -fPIC -arch=sm_30 \ -gencode=arch=compute_30,code=sm_30 \ -gencode=arch=compute_50,code=sm_50 \ -gencode=arch=compute_52,code=sm_52 \ -gencode=arch=compute_60,code=sm_60 \ -gencode=arch=compute_61,code=sm_61 \ -gencode=arch=compute_62,code=sm_62 \
same problem
I am still not sure what is the reason of the problem. I tried to set CUDA_PATH as suggested @PHDPeter. It didn't help for pytorch 1.x for CUDA 9.2 (tried buiding pytorch from source as well). However, on the other machine with pytorch 1.1 and CUDA 10.0 everything works.
I am still not sure what is the reason of the problem. I tried to set CUDA_PATH as suggested @PHDPeter. It didn't help for pytorch 1.x for CUDA 9.2 (tried buiding pytorch from source as well). However, on the other machine with pytorch 1.1 and CUDA 10.0 everything works.
No module named 'roi_align._ext.crop_and_resize._crop_and_resize' i mat the same problem, can you help how to fix it?
Same error here... I am trying to use this verison instead..
Rename the folder "roi_align" (in your decompressed directory) to other name solves the problem.
I solved this. For me, this was an issue of (due to loading my CUDA via a package) the CUDA_PATH in the install.sh file. In my case, I need to change it to "/usr/lib/nvidia-cuda-toolkit" but here is a link for finding when your system has placed your CUDA_PATH https://stackoverflow.com/questions/36279045/where-did-cuda-get-installed-in-my-computer Hope this helps
if I don't have CUDA, can I solve this ?
Thanks to @Hub-Tian , just like he(she) said, the name of roi_align folder is conflict with the same named roi_align package built in '..\Lib\site-packages\roi_align-0.0.2-py3.7-win-amd64.egg' , so rename the folder name in the project and related import script works.
Thanks to @Hub-Tian , just like he(she) said, the name of roi_align folder is conflict with the same named roi_align package built in '..\Lib\site-packages\roi_align-0.0.2-py3.7-win-amd64.egg' , so rename the folder name in the project and related import script works.
Did you change all the name of "roi_align"? or just the floder
Thanks to @Hub-Tian , just like he(she) said, the name of roi_align folder is conflict with the same named roi_align package built in '..\Lib\site-packages\roi_align-0.0.2-py3.7-win-amd64.egg' , so rename the folder name in the project and related import script works.
Did you change all the name of "roi_align"? or just the floder I have just changed the name of roi_align folder and roi_align.py in the folder.
Thanks to @Hub-Tian , just like he(she) said, the name of roi_align folder is conflict with the same named roi_align package built in '..\Lib\site-packages\roi_align-0.0.2-py3.7-win-amd64.egg' , so rename the folder name in the project and related import script works.
Did you change all the name of "roi_align"? or just the floder I have just changed the name of roi_align folder and roi_align.py in the folder.
Thank you for your advice, I have solved my problem.
For anybody who was getting ModuleNotFound Errors after building roi_align. Restart the python kernel if you're running from a notebook and make sure you don't have a folder named roi_align in your current working directory..!!
Rename the folder "roi_align" (in your decompressed directory) to other name solves the problem.
brilliant, this solves the issue. Thank you
For anybody who was getting ModuleNotFound Errors after building roi_align. Restart the python kernel if you're running from a notebook and make sure you don't have a folder named roi_align in your current working directory..!!
I rename my "roi_align" folder to "roi_align_src", and change the referenced import scripts. But after I rerun the setup instrunction, the ModuleNotFound Errors also occurs.Could you please do me a favor?
For anybody who was getting ModuleNotFound Errors after building roi_align. Restart the python kernel if you're running from a notebook and make sure you don't have a folder named roi_align in your current working directory..!!
I rename my "roi_align" folder to "roi_align_src", and change the referenced import scripts. But after I rerun the setup instrunction, the ModuleNotFound Errors also occurs.Could you please do me a favor?
after installing try running test.sh from another directory or try the demo code in the readme. If it still persists there might have been a problem with the install itself. i.e you should be able to import roi_align from a python repl from any directory.
I solved this. For me, this was an issue of (due to loading my CUDA via a package) the CUDA_PATH in the install.sh file. In my case, I need to change it to "/usr/lib/nvidia-cuda-toolkit" but here is a link for finding when your system has placed your CUDA_PATH https://stackoverflow.com/questions/36279045/where-did-cuda-get-installed-in-my-computer Hope this helps
if I don't have CUDA, can I solve this ?
yes you can :)
can you send the modified directory here.for me still it shows the same error even if i do correct installation
can you send the modified directory here.for me still it shows the same error even if i do correct installation
I have tried two methods mentioned above but didn't work. So I complied with JIT and it worked.
from torch.utils.cpp_extension import load
crop_and_resize_cpu = load(name="crop_and_resize", extra_include_paths=["src"], sources=["/home/omnisky/sun/sparse-rcnn-versions/SparseRCNN-4.10-roiTrans/RoIAlign.pytorch-master/roi_align_1/src/crop_and_resize.cpp"], verbose=True) if torch.cuda.is_available():
crop_and_resize_gpu = load(name="crop_and_resize_gpu",
extra_include_paths=["src"],
sources=["/home/omnisky/sun/sparse-rcnn-versions/SparseRCNN-4.10-roiTrans/RoIAlign.pytorch-master/roi_align_1/src/crop_and_resize_gpu.cpp", "/home/omnisky/sun/sparse-rcnn-versions/SparseRCNN-4.10-roiTrans/RoIAlign.pytorch-master/roi_align_1/src/cuda/crop_and_resize_kernel.cu"],
verbose=True)
you may just use the code above in crop_and_resize.py. If you use JIT, you don't have to run "install.py". The "roi_align_1" thing is because I tried the rename method(which didn't work).
can you send the modified directory here.for me still it shows the same error even if i do correct installation
I have tried two methods mentioned above but didn't work. So I complied with JIT and it worked.
from torch.utils.cpp_extension import load
crop_and_resize_cpu = load(name="crop_and_resize", extra_include_paths=["src"], sources=["/home/omnisky/sun/sparse-rcnn-versions/SparseRCNN-4.10-roiTrans/RoIAlign.pytorch-master/roi_align_1/src/crop_and_resize.cpp"], verbose=True) if torch.cuda.is_available():
crop_and_resize_gpu = load(name="crop_and_resize_gpu",
extra_include_paths=["src"],
sources=["/home/omnisky/sun/sparse-rcnn-versions/SparseRCNN-4.10-roiTrans/RoIAlign.pytorch-master/roi_align_1/src/crop_and_resize_gpu.cpp", "/home/omnisky/sun/sparse-rcnn-versions/SparseRCNN-4.10-roiTrans/RoIAlign.pytorch-master/roi_align_1/src/cuda/crop_and_resize_kernel.cu"],
verbose=True)
you may just use the code above in crop_and_resize.py. If you use JIT, you don't have to run "install.py". The "roi_align_1" thing is because I tried the rename method(which didn't work).
auto reply
您好,已收到您的邮件。
can you send the modified directory here.for me still it shows the same error even if i do correct installation
I have tried two methods mentioned above but didn't work. So I complied with JIT and it worked.
from torch.utils.cpp_extension import load #import roi_align_1.crop_and_resize_cpu as crop_and_resize_cpu crop_and_resize_cpu = load(name="crop_and_resize", extra_include_paths=["src"], sources=["/home/omnisky/sun/sparse-rcnn-versions/SparseRCNN-4.10-roiTrans/RoIAlign.pytorch-master/roi_align_1/src/crop_and_resize.cpp"], verbose=True) if torch.cuda.is_available(): #import roi_align_1.crop_and_resize_gpu as crop_and_resize_gpu crop_and_resize_gpu = load(name="crop_and_resize_gpu", extra_include_paths=["src"], sources=["/home/omnisky/sun/sparse-rcnn-versions/SparseRCNN-4.10-roiTrans/RoIAlign.pytorch-master/roi_align_1/src/crop_and_resize_gpu.cpp", "/home/omnisky/sun/sparse-rcnn-versions/SparseRCNN-4.10-roiTrans/RoIAlign.pytorch-master/roi_align_1/src/cuda/crop_and_resize_kernel.cu"], verbose=True) you may just use the code above in crop_and_resize.py. If you use JIT, you don't have to run "install.py". The "roi_align_1" thing is because I tried the rename method(which didn't work).
May I ask how to use JIT? When I used your method, it reported this error that NameError: name 'load' is not defined. I don't know how to solve it.
Same error here... I am trying to use this verison instead..
请问下你是怎么修改的呢,可以发下你改的给个参考吗?我不太清楚RoIAlign里的参数需要作何改变?谢谢
您好,已收到您的邮件。
auto reply
您好,已收到您的邮件。
auto reply
I am using anaconda 3. When I run
it works fine without any errors:
However, when I run
it outputs the following:
What could be the reason of the problem? How to fix it?