Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError from crop_and_resize.py : "initializer for ctype 'struct THCudaTensor *' must be a pointer to same type, not cdata 'struct THFloatTensor *" #26

Open
kathydo opened this issue Mar 31, 2019 · 2 comments

Comments

@kathydo
Copy link

kathydo commented Mar 31, 2019

Hi, I am trying to use the CropAndResize function on a GPU and am getting the following error. Does anyone have any suggestions? I am running with Python 3.7 and Pytorch 0.4.1.

X_conv451_crop = CropAndResizeFunction(self.crop_height, self.crop_width, 0)(X_conv451_torch, boxes, box_index) File "/home/kdo/anaconda3/envs/honours/lib/python3.7/site-packages/roi_align-0.0.1-py3.7.egg/roi_align/crop_and_resize.py", line 23, in forward self.extrapolation_value, self.crop_height, self.crop_width, crops) File "/home/kdo/anaconda3/envs/honours/lib/python3.7/site-packages/torch/utils/ffi/__init__.py", line 202, in safe_call result = torch._C._safe_call(*args, **kwargs) TypeError: initializer for ctype 'struct THCudaTensor *' must be a pointer to same type, not cdata 'struct THFloatTensor *'

@zhongyingji
Copy link

Did you solve the problem, I get stuck with the same issue

@kathydo
Copy link
Author

kathydo commented May 13, 2019

Hey, if I remember correctly it was a Pytorch version issue. Using this version of crop an resize only allows pytorch 0.4.0 and before actually (not Pytorch 0.4.1). I ended up using the function from https://github.com/multimodallearning/pytorch-mask-rcnn which supports pytorch 0.4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants