Comments (3)
Do you have CUDA enabled GPU? The default argument for running the Transformer from scratch code is cuda. If you want to run it on CPU you need to change this call. Specifically change the call of
model = Transformer(src_vocab_size, trg_vocab_size, src_pad_idx, trg_pad_idx).to(
device
)
to
model = Transformer(src_vocab_size, trg_vocab_size, src_pad_idx, trg_pad_idx, device='cpu').to(
device
)
Edit:
I think since we're setting the device a few lines below we should actually do device=device, rather than device='cpu' and this is definitely an improvement to the code. Will fix this
from machine-learning-collection.
I'm closing this, let me know if you still wonder about this!
from machine-learning-collection.
thank you very much, I couldn´t test it yet but thank you for the suggestion to fix the issue, will try it as soon as I can, best wishes
from machine-learning-collection.
Related Issues (20)
- YOLO v1 - why using Adam as the optimizer HOT 1
- Question in self-attention from 'transformer from scratch'
- Can you add a cff so your work can be cited? HOT 1
- Error in train.py HOT 1
- add header=None to pd.read_csv
- -
- Tensor tutorial 3: Neural Networks with Sequential and Functional API Issue
- Pretrained weight for semantic segmentation
- Image Captioning gives following error: TypeError: relu(): argument 'input' (position 1) must be Tensor, not InceptionOutputs HOT 1
- Re. Height and Width of image, mask or masks should be equal. You can disable shapes check by setting a parameter is_check_shapes=False of Compose class
- Weights ESRGAN
- YOLO v1 loss
- SelfAttention bug on Scores * V HOT 1
- Pytorch/GANs /CycleGAN/generator_model.py | Test function has a minor issue.
- Issue with YOLOv3 Anchors on Scale HOT 2
- ConvBlock for Discriminator
- type error: Trainer.__init__() got an unexpected keyword argument 'auto_lr_find'
- why is z_dim=64 in simple GAN code
- Very low validation accuracy while training from scratch on CIFAR10
- YOLOv3 - OpenCV error in function 'warpAffine': Argument 'borderMode' is required to be an integer
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 machine-learning-collection.