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

RuntimeError: expected type torch.cuda.FloatTensor but got torch.FloatTensor #34

Closed
lightfate opened this issue Jun 23, 2019 · 2 comments

Comments

@lightfate
Copy link

Hi, @lukemelas ~
I'm so excited about your code, but today, after i upgrade the pip package today, a new problem appeared:


C:\ProgramData\Anaconda3\lib\site-packages\efficientnet_pytorch\utils.py in drop_connect(inputs, p, training)
72 random_tensor += torch.rand([batch_size, 1, 1, 1], dtype=inputs.dtype) # uniform [0,1)
73 binary_tensor = torch.floor(random_tensor)
---> 74 output = inputs / keep_prob * binary_tensor
75 return output
76
RuntimeError: expected type torch.cuda.FloatTensor but got torch.FloatTensor


I sure that i don't change any of my code, just upgrade the pip package "efficientNet-Pytroch"
in my code, i use your model like:


from efficientnet_pytorch import EfficientNet
modelPre = EfficientNet.from_pretrained('efficientnet-b0')


@lukemelas
Copy link
Owner

See #32

This is fixed in master :)

@lightfate
Copy link
Author

See #32

This is fixed in master :)

Thanks~

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