Giter Site home page Giter Site logo

dynamic-classification's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dynamic-classification's Issues

RuntimeError when running train.py

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.