simonm3 / maskr

Other
27 stars 4 forks source link

torch.utils.ffi is deprecated #1

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hi there,

thank you for the good structured repo here. Unfortunately I am getting this error (relatively new to python): Compiling crop_and_resize kernels by nvcc... ./make.sh: line 12: nvcc: command not found Traceback (most recent call last): File "build.py", line 3, in from torch.utils.ffi import create_extension File "/Users/****/opt/anaconda3/lib/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. Compiling nms kernels by nvcc... ./make.sh: line 20: nvcc: command not found Traceback (most recent call last): File "build.py", line 3, in from torch.utils.ffi import create_extension File "/Users/****/opt/anaconda3/lib/python3.7/site-packages/torch/utils/ffi/init.py", line 1, in raise ImportError("torch.utils.ffi is deprecated. Please use cpp extensions instead.")

What can I da about it?

Downgrading to torch 1.0 does not help (as intended in another issue). Also I dont want to downgrade to 0.4 since the version is too old. Also I dont know how to change it to torch.utils.cpp_extension.

Regards

simonm3 commented 4 years ago

You need nvcc installed as this compiles stuff for cuda. it is part of cudatoolkit.

The other issue I am not sure. However the code was working with pytorch 1.0. You might try finding old source code for torch.utils.ffi and putting it in your python path. I remember having the error and doing something like that to fix it. I think you only need it to compile the c code. Alternatively find a cpp version of nms and cropresize. At the time nobody had done that though.

On Mon, 9 Dec 2019 at 10:22, 1seck notifications@github.com wrote:

Hi there,

thank you for the good structured repo here. Unfortunately I am getting this error (relatively new to python): Compiling crop_and_resize kernels by nvcc... ./make.sh: line 12: nvcc: command not found Traceback (most recent call last): File "build.py", line 3, in from torch.utils.ffi import create_extension File "/Users/

/opt/anaconda3/lib/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. Compiling nms kernels by nvcc... ./make.sh: line 20: nvcc: command not found Traceback (most recent call last): File "build.py", line 3, in from torch.utils.ffi import create_extension File "/Users//opt/anaconda3/lib/python3.7/site-packages/torch/utils/ffi/init.py", line 1, in raise ImportError("torch.utils.ffi is deprecated. Please use cpp extensions instead.")

What can I da about it?

Downgrading to torch 1.0 does not help (as intended in another issue). Also I dont want to downgrade to 0.4 since the version is too old. Also I dont know how to change it to torch.utils.cpp_extension.

Regards

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/simonm3/maskr/issues/1?email_source=notifications&email_token=AAJE32NCGD5UI2HZOFJFTD3QXYL5XA5CNFSM4JYGXRH2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H7A256A, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJE32PJ2LPHU3OBXJOU2ELQXYL5XANCNFSM4JYGXRHQ .

ghost commented 4 years ago

Hi Simon,

thank you for the answer, I will try this although I am looking into facebooks implementation detectron2 right now.

Am 10.12.2019 um 19:05 schrieb simon notifications@github.com:

You need nvcc installed as this compiles stuff for cuda. it is part of cudatoolkit.

The other issue I am not sure. However the code was working with pytorch 1.0. You might try finding old source code for torch.utils.ffi and putting it in your python path. I remember having the error and doing something like that to fix it. I think you only need it to compile the c code. Alternatively find a cpp version of nms and cropresize. At the time nobody had done that though.

On Mon, 9 Dec 2019 at 10:22, 1seck notifications@github.com wrote:

Hi there,

thank you for the good structured repo here. Unfortunately I am getting this error (relatively new to python): Compiling crop_and_resize kernels by nvcc... ./make.sh: line 12: nvcc: command not found Traceback (most recent call last): File "build.py", line 3, in from torch.utils.ffi import create_extension File "/Users/

/opt/anaconda3/lib/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. Compiling nms kernels by nvcc... ./make.sh: line 20: nvcc: command not found Traceback (most recent call last): File "build.py", line 3, in from torch.utils.ffi import create_extension File "/Users//opt/anaconda3/lib/python3.7/site-packages/torch/utils/ffi/init.py", line 1, in raise ImportError("torch.utils.ffi is deprecated. Please use cpp extensions instead.")

What can I da about it?

Downgrading to torch 1.0 does not help (as intended in another issue). Also I dont want to downgrade to 0.4 since the version is too old. Also I dont know how to change it to torch.utils.cpp_extension.

Regards

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/simonm3/maskr/issues/1?email_source=notifications&email_token=AAJE32NCGD5UI2HZOFJFTD3QXYL5XA5CNFSM4JYGXRH2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H7A256A, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJE32PJ2LPHU3OBXJOU2ELQXYL5XANCNFSM4JYGXRHQ .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/simonm3/maskr/issues/1?email_source=notifications&email_token=AB6B2R2GJE5QQGRN6FNETMDQX7K6DA5CNFSM4JYGXRH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGQGASI#issuecomment-564158537, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6B2R3MSN77KJYW4YP3R2TQX7K6DANCNFSM4JYGXRHQ.

ghost commented 4 years ago

I actually like fastai more than fb's stuff but am undecided since they are really good supported. But fastai has the 1-cycle super convergence training etc. and your implementation is just more straight forward than fbs with lots of variables and yaml files...

ghost commented 4 years ago

its also part of torchvision now (https://github.com/pytorch/vision/blob/master/torchvision/ops/boxes.py)