Comments (1)
So the way DataParallel works is the .forward
method takes cpu data (note that the tensors have to be on cpu) and broadcasts it to all the available GPUs where it passes the GPU data to the model's forward method.
What you tried didn't work because you only passed the data to the model's forward method not DataParallel's forward method. So you need to
- Use the full dataparallel module for forward
- Any time you need to access a model attribute, access it from the original modelpar.module module
- Use cpu data type so that the model's forward can automatically send the data to the right gpu.
We had an implementation for this working in our original release of the codebase if you'd like a reference https://github.com/NVIDIA/sentiment-discovery/releases/tag/v0.1. It was too difficult to maintain while trying to add new features so we deprecated it.
from sentiment-discovery.
Related Issues (20)
- Reproducing SemEval results
- Broken Pipe Error - main.py
- AttributeError: 'DataLoader' object has no attribute '_dataset_kind' HOT 7
- Unable to use standalone transformer language model
- Can I use the pretrained emotion classification on new dataset for subset of emotion?
- run_classifier for emotion classification? HOT 1
- Can some body fix this library?
- KeyError in transformer model HOT 1
- other languages, camemBERT/flauBERT model
- Error(s) in loading state_dict for TransformerDecoderModel
- Unable to run train.py Keras retinanet in Ubuntu on Remote server HOT 1
- run_classifier.py invalid arguments HOT 2
- "AttributeError: 'DataLoader' object has no attribute '_dataset_kind'" How should I solve this error? HOT 2
- error: command 'gcc' failed with exit status 1
- The emotion classification model's performance is almost the same as a random guess HOT 4
- How to run_classifier on Semeval data for prediction?
- how to use transformer_semeval.clf?
- AttributeError: 'DataLoader' object has no attribute 'device'
- get the emotion score of a sentence
- the API for emotion Category
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 sentiment-discovery.