CCNet icon indicating copy to clipboard operation
CCNet copied to clipboard

build.py issue

Open ginobilinie opened this issue 5 years ago • 16 comments

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 avatar Oct 25 '19 00:10 ginobilinie

The master branch requires pytorch==0.4.1, maybe you can try the Pytorch-1.1 branch.

speedinghzl avatar Oct 26 '19 12:10 speedinghzl

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 avatar Nov 19 '19 12:11 Fly-dream12

@Fly-dream12 You need install inplace_abn package. Please refer to ReadMe.

speedinghzl avatar Nov 19 '19 12:11 speedinghzl

Thanks. @speedinghzl

ginobilinie avatar Nov 20 '19 00:11 ginobilinie

@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!

cauivy avatar Feb 03 '20 09:02 cauivy

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 avatar Feb 04 '20 07:02 cauivy

@cauivy You do not have to compile cc_attention if you are using the Pytorch-1.1 branch.

speedinghzl avatar Feb 04 '20 07:02 speedinghzl

@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 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!

cauivy avatar Feb 05 '20 01:02 cauivy

@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 avatar Feb 05 '20 10:02 speedinghzl

@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

Caius-Lu avatar Feb 16 '20 09:02 Caius-Lu

@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 avatar Feb 25 '20 10:02 cauivy

@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 avatar Feb 25 '20 10:02 cauivy

@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!

cauivy avatar Feb 25 '20 10:02 cauivy

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.

Caius-Lu avatar Feb 25 '20 12:02 Caius-Lu

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.

Caius-Lu avatar Feb 27 '20 14:02 Caius-Lu

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.

kimkimyoung avatar Jun 25 '21 09:06 kimkimyoung