Comments (2)
Hi man ✋ , try uncomment the enumerate(dataloader) like here and If your model and data are on the GPU, you should move your model and data to the GPU before iterating through the dataloader. You can do this by sending both the model and the data to the device using .to(device).
progress_bar = tqdm(
enumerate(dataloader),
desc=f"Training Epoch {epoch}",
total=len(dataloader),
disable=disable_progress_bar
)
for batch_idx, (X, y) in progress_bar:
# Send data to target device
X, y = X.to(device), y.to(device)
# 1. Forward pass
y_pred = model(X)
Make sure device is properly defined and refers to the GPU (e.g., device = torch.device("cuda:0").
please let me know if it helps you 😄
from pytorch-deep-learning.
Related Issues (20)
- There is a typing error.
- Why can't we use this formula for 'Gini Impurity of a Leaf' ## "Gini Impurity of a Leaf = 1 - ( Lowest of the (Yes Probability, No Probability) )" HOT 2
- 09 Model development: TypeError: AsyncConnectionPool.__init__() got an unexpected keyword argument 'socket_options'
- CIFAR 10 dataset
- 05_Pytorch going Modular model_builder.py HOT 1
- 03_pytorch_computer_vision clarification on a comment
- Model not learning
- Where to go from here HOT 1
- Cant find solution to error - Model 2: Training Our First CNN and Evaluating Its Results HOT 1
- 06 Error with pretrained Model
- Clarification for discussion of shared memory in `torch.from_numpy(ndarray)` and `torch.Tensor.numpy()` HOT 6
- Incorrect Batch Indexing in FashionMNIST Batched Image: Displays 32 Instead of 31
- How to add skip connections to the model? HOT 1
- 04_pytorch_custom_datasets_video.ipynb - RuntimeError: only batches of spatial targets supported (3D tensors) but got targets of dimension: 1 HOT 4
- segmentation fault
- 09. PyTorch Model Deployment - **9.3 Uploading to Hugging Face**, RuntimeError: Could not infer dtype of numpy.uint8 HOT 3
- Helper Function github link requests error HOT 2
- How to Create GitHub Pages from Scratch? HOT 1
- Modular approch for transfer learning HOT 2
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 pytorch-deep-learning.