asappresearch / dynamic-classification Goto Github PK
View Code? Open in Web Editor NEWCode from the paper: "Metric Learning for Dynamic Text Classification"
License: MIT License
Code from the paper: "Metric Learning for Dynamic Text Classification"
License: MIT License
Hello,
First of all, thank you for sharing your code. Unfortunately, I'm running into an exception when trying to run the train.py function. The exception is the following
Traceback (most recent call last):
File "dynamic_classification/train.py", line 197, in <module>
train(args)
File "dynamic_classification/train.py", line 90, in train
pred = model(query, support, support_label)
File "/home/usr-lin-ai/anaconda3/envs/dedupe_torch/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in __call__
result = self.forward(*input, **kwargs)
File "/home/usr-lin-ai/Deduplication/PythonDeduper/dynamic_classification/model.py", line 298, in forward
query_embeddings = self.embedding_dropout(self.embedding(query))
File "/home/usr-lin-ai/anaconda3/envs/dedupe_torch/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in __call__
result = self.forward(*input, **kwargs)
File "/home/usr-lin-ai/anaconda3/envs/dedupe_torch/lib/python3.7/site-packages/torch/nn/modules/sparse.py", line 114, in forward
self.norm_type, self.scale_grad_by_freq, self.sparse)
File "/home/usr-lin-ai/anaconda3/envs/dedupe_torch/lib/python3.7/site-packages/torch/nn/functional.py", line 1484, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected object of device type cuda but got device type cpu for argument #1 'self' in call to _th_index_select
I have tried this with both PyTorch 1.4 and 1.3 and with different datasets and get the same exception every time. I use cudnn 7.6.5 and cudatoolkit 10.1.243. I have not modified the script code in any way.
I use the same kind of conda environments for many other projects that use Pytorch or Tensorflow and they can access my GPU successfully, so I don't think the problem is coming from my setup,
I have tried fixing this but can't find the error, I get the feeling that this comes from deeper within the code. Could you provide me with some insights on this problem, please?
You can find an example of toy dataset I tried here
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.