CCNet
CCNet copied to clipboard
build.py issue
Hi, thanks for the great work and code.
When I try to build the code, the build.sh is fine but when I run the build.py, an error occurs: "ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead."
I'm currently using pytorch 1.2.0. Can you please let me know some solution for this problem? I have searched some solutions but all of them failed.
Thanks.
The master branch requires pytorch==0.4.1, maybe you can try the Pytorch-1.1 branch.
There is no corresponding libs for bn module as the RCCA module is compiled.
In network/cc_net.py from inplace_abn import InPlaceABN, InPlaceABNSync This line may run into an error. @ speedinghzl
@Fly-dream12 You need install inplace_abn package. Please refer to ReadMe.
Thanks. @speedinghzl
@speedinghzl Hello! I configured my conda-env with python3.7.1 and pytorch1.11. After complied according to https://github.com/speedinghzl/CCNet/tree/pytorch-1.1#requirements, I still got the error: from torch.utils.ffi import _wrap_function raise ImportError("torch.utils.ffi is deprecated. Please use cpp extensions instead.") ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.
Do you have any idea about this? Thank you!
Hi, thanks for the great work and code.
When I try to build the code, the build.sh is fine but when I run the build.py, an error occurs: "ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead."
I'm currently using pytorch 1.2.0. Can you please let me know some solution for this problem? I have searched some solutions but all of them failed.
Thanks. @ginobilinie Hi, I got the same problem with pytorch1.11. Did you solve the problem?
@cauivy You do not have to compile cc_attention if you are using the Pytorch-1.1 branch.
@cauivy You do not have to compile cc_attention if you are using the Pytorch-1.1 branch.
@speedinghzl Thanks for your reply! I used Pythorch-1.1 branch and followed the README:
Install Pytorch-1.1
$ conda install pytorch torchvision cudatoolkit=9.0 -c pytorch
Install Apex
$ git clone https://github.com/NVIDIA/apex $ cd apex $ pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./
Install Inplace-ABN
$ git clone https://github.com/mapillary/inplace_abn.git $ cd inplace_abn $ python setup.py install
After the installation above, I still got the error:
File ".../python3.7/site-packages/torch/utils/ffi/init.py", line 1, in
Do you have any idea about this? Thank you!
@cauivy Is the error message is thrown out when you run the script? After checking my PyTorch, my Pytorch version is 1.2.0. But Pytorch 1.1 should be ok. Please re-check out the pytorch-1.1 branch and run with pytorch>1.1. The master branch supports Pytorch 0.4.
@cauivy Is the error message is thrown out when you run the script? After checking my PyTorch, my Pytorch version is 1.2.0. But Pytorch 1.1 should be ok. Please re-check out the pytorch-1.1 branch and run with pytorch>1.1. The master branch supports Pytorch 0.4. I used the version of pytroch1.1, but I still got this error. I compiled according to the above several times. How can I solve this problem?I have changed the version of pytorch, tried both 1.1 and 1.2, but still didn't resolve the compilation issue
@cauivy Is the error message is thrown out when you run the script? After checking my PyTorch, my Pytorch version is 1.2.0. But Pytorch 1.1 should be ok. Please re-check out the pytorch-1.1 branch and run with pytorch>1.1. The master branch supports Pytorch 0.4.
@speedinghzl Sorry for my late reply. After changing into pytorch-1.1 branch, my env works! Thank you!
@cauivy Is the error message is thrown out when you run the script? After checking my PyTorch, my Pytorch version is 1.2.0. But Pytorch 1.1 should be ok. Please re-check out the pytorch-1.1 branch and run with pytorch>1.1. The master branch supports Pytorch 0.4. I used the version of pytroch1.1, but I still got this error. I compiled according to the above several times. How can I solve this problem?I have changed the version of pytorch, tried both 1.1 and 1.2, but still didn't resolve the compilation issue
After changing the pytorch-1.1 branch, the error was gone in my side. Please make sure you are using the pytorch-1.1 branch with 'git branch' command.
@cauivy Is the error message is thrown out when you run the script? After checking my PyTorch, my Pytorch version is 1.2.0. But Pytorch 1.1 should be ok. Please re-check out the pytorch-1.1 branch and run with pytorch>1.1. The master branch supports Pytorch 0.4.
@speedinghzl Sorry for my late reply. After changing into pytorch-1.1 branch, my env works! Thank you!
@speedinghzl BTW, I want to run your model on my own data, I found images were subtracted mean values: IMG_MEAN = np.array((104.00698793,116.66876762,122.67891434), dtype=np.float32)
I wonder where are these three values from? Thanks in advance!
Thank you! I find my mistakes,
在2020-02-25 18:21:04,[email protected]写道:
@cauivy Is the error message is thrown out when you run the script? After checking my PyTorch, my Pytorch version is 1.2.0. But Pytorch 1.1 should be ok. Please re-check out the pytorch-1.1 branch and run with pytorch>1.1. The master branch supports Pytorch 0.4. I used the version of pytroch1.1, but I still got this error. I compiled according to the above several times. How can I solve this problem?I have changed the version of pytorch, tried both 1.1 and 1.2, but still didn't resolve the compilation issue
After changing the pytorch-1.1 branch, the error was gone in my side. Please make sure you are using the pytorch-1.1 branch with 'git branch' command.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
I also want to ask a question, I want to run this program on windows10, but inplace_abn cannot be compiled by win10, so if I want to replace the inplace_abn library, how can I do it? thank you very much!
在2020-02-25 18:24:06,[email protected]写道:
@cauivy Is the error message is thrown out when you run the script? After checking my PyTorch, my Pytorch version is 1.2.0. But Pytorch 1.1 should be ok. Please re-check out the pytorch-1.1 branch and run with pytorch>1.1. The master branch supports Pytorch 0.4.
@speedinghzl Sorry for my late reply. After changing into pytorch-1.1 branch, my env works! Thank you!
@speedinghzl BTW, I want to run your model on my own data, I found images were subtracted mean values: IMG_MEAN = np.array((104.00698793,116.66876762,122.67891434), dtype=np.float32)
I wonder where are these three values from? Thanks in advance!
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
Thank you! I find my mistakes, 在2020-02-25 18:21:04,[email protected]写道: @cauivy Is the error message is thrown out when you run the script? After checking my PyTorch, my Pytorch version is 1.2.0. But Pytorch 1.1 should be ok. Please re-check out the pytorch-1.1 branch and run with pytorch>1.1. The master branch supports Pytorch 0.4. I used the version of pytroch1.1, but I still got this error. I compiled according to the above several times. How can I solve this problem?I have changed the version of pytorch, tried both 1.1 and 1.2, but still didn't resolve the compilation issue After changing the pytorch-1.1 branch, the error was gone in my side. Please make sure you are using the pytorch-1.1 branch with 'git branch' command. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
Hi Lu, how did you fix the problem? and what mistakes you had found? I can not fix it.