Comments (5)
Hi @Tloops,
Can you share a minimal snippet of your code?
A quick solution would be to explicitly do .cuda()
in the call.
from adapool.
Thanks for your reply!
I've tried adapool_cuda.forward_3d_edscw(input.contiguous().cuda(), kernel, stride, output, return_mask, mask)
in idea.py
, but I still get the same error above.
A minimal snippet of my code (the model part) is as follows:
import adapool_cuda
from adaPool import AdaPool3d
class CNN3D(nn.Module):
def __init__(self, num_classes):
super(CNN3D, self).__init__()
self.cnn = nn.Sequential(
BasicConv(1, 8, kernel_size=(3, 3, 3), stride=(1, 1, 1), padding=(1, 1, 1)),
nn.MaxPool3d(kernel_size=(2, 2, 2), stride=(2, 2, 2), padding=(1, 0, 1)),
BasicConv(8, 16, kernel_size=(3, 3, 3), stride=(1, 1, 1), padding=(1, 1, 1)),
nn.MaxPool3d(kernel_size=(2, 2, 2), stride=(2, 2, 2), padding=(1, 0, 0)),
BasicConv(16, 32, kernel_size=(3, 3, 3), stride=(1, 1, 1), padding=(1, 1, 1)),
nn.MaxPool3d(kernel_size=(2, 2, 2), stride=(2, 2, 2), padding=(1, 0, 1)),
BasicConv(32, 64, kernel_size=(3, 3, 3), stride=(1, 1, 1), padding=(1, 1, 1)),
nn.MaxPool3d(kernel_size=(2, 2, 2), stride=(2, 2, 2), padding=(0, 0, 1)),
BasicConv(64, 128, kernel_size=(3, 3, 3), stride=(1, 1, 1), padding=(1, 1, 1)),
nn.MaxPool3d(kernel_size=(2, 2, 2), stride=(2, 2, 2), padding=(1, 1, 0)),
)
self.pool = AdaPool3d(kernel_size=(6,7,6), beta=torch.Tensor([[[0.5]]]))
self.fc = nn.Linear(128, num_classes)
self.softmax = nn.Softmax()
def forward(self, x):
x = self.cnn(x)
x = self.pool(x)
x = x.view(x.size(0), -1)
x = self.fc(x)
x = self.softmax(x)
return x
from adapool.
You need the beta tensor to also be in cuda, i.e:
pool = AdaPool3d(kernel_size=(6,7,6), beta=torch.Tensor([[[0.5]]]).cuda())
from adapool.
You need the beta tensor to also be in cuda, i.e:
pool = AdaPool3d(kernel_size=(6,7,6), beta=torch.Tensor([[[0.5]]]).cuda())
I've tried it but I still get the same error above. Really strange... π
from adapool.
I used the script below on two different machines:
import torch
import adapool_cuda
from adaPool import AdaPool3d
pool = AdaPool3d(kernel_size=(6,7,6), beta=torch.Tensor([[[0.5]]]).cuda())
x = torch.rand(1,1,16,224,224).cuda()
out = pool(x)
print(out.shape)
Wasn't able to reproduce the error
from adapool.
Related Issues (14)
- δ½ ε₯½ HOT 1
- Installation issue on Google Colab HOT 2
- can you share the code for object detection? HOT 1
- CAN HOT 3
- About Adaptive Pool 2d HOT 2
- εεδΌ ζηζ₯ι HOT 1
- The version of pytorch and how to deal with `nan_to_num` function in lower versions HOT 1
- pytorch HOT 2
- how to use it in yolov5 HOT 1
- Does AdaPool2d's beta require fixed image size? HOT 1
- How to set the beta? HOT 3
- Can I use it in kaggle? HOT 2
- Solution: Unresolved extern function '_Z3powdi'β HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adapool.