Closed ran337287 closed 5 years ago
No. It only works for 0.4 and 1.0 for now. However, you could try to use the pytorch-0.4 branch under pytorch 0.3.1, since their APIs are similar...
Can I modify prroi_pool.py to apply for pytorch 0.3.1? And my cuda version is 9.0
Is there be any error if you directly use the code from the branch pytorch0.4
under pytorch0.3.1?
My test code is as follows, and modify -arch=sm_61, then the error is
"
File "/home/ran/PreciseRoIPooling/pytorch/prroi_pool/functional.py", line 40, in forward
dtype=features.dtype, device=features.device
AttributeError: 'torch.cuda.FloatTensor' object has no attribute 'dtype'"
import torch
from torch.autograd import Variable
from pytorch.prroi_pool import PrRoIPool2D
pool = PrRoIPool2D(7,7, spatial_scale=0.5)
features = Variable(torch.rand((4,16,24,32)).cuda())
rois = torch.FloatTensor([
[0,0,0,14,14],
[1,14,14,28,28]])
rois = Variable(rois.cuda())
out = pool(features, rois)
I see. Then you can try the old-style API:
output = features.new((nr_rois, nr_channels, pooled_height, pooled_width)).zero_()
It works!! Thank you very much!
Great!
Hi, Is this code available for pytorch 0.3.1?