Coder Social home page Coder Social logo

srviest / char-cnn-text-classification-pytorch Goto Github PK

View Code? Open in Web Editor NEW
176.0 9.0 47.0 24.43 MB

Character-level Convolutional Neural Networks for text classification in PyTorch

License: Apache License 2.0

Python 100.00%
sentiment-analysis cnn-text-classification pytorch-implmention natural-language-processing

char-cnn-text-classification-pytorch's Issues

No learning

I am trying the code, but precision is not improving. Model keeps on selecting only one of the classes:

image

image

Thanks

Not converging!

I have been able to run the model as is but it simply not converging!
For how many epochs I should run the model?

Error in Pytorch 1.0.0

Hi! I am using Pytorch 1.0.0 with Python 2.7 and I get the error below when running python train.py command:

Implicit dimension choice for log_softmax has been deprecated. Change the call to include dim=X as an argument.
x = self.log_softmax(x)
train.py:120: UserWarning: torch.nn.utils.clip_grad_norm is now deprecated in favor of torch.nn.utils.clip_grad_norm_.
torch.nn.utils.clip_grad_norm(model.parameters(), args.max_norm)
Traceback (most recent call last):
File "train.py", line 282, in
main()
File "train.py", line 279, in main
train(train_loader, dev_loader, model, args)
File "train.py", line 137, in train
loss.data[0],
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number

How to fix this? Thanks!

IndexError: list index out of range

When I was training, I met a problem.
File "train.py", line 278, in <module> main() File "train.py", line 275, in main train(train_loader, dev_loader, model, args) File "train.py", line 97, in train model = torch.nn.DataParallel(model).cuda() File "/usr/local/lib/python3.5/dist-packages/torch/nn/parallel/data_parallel.py", line 47, in __init__ output_device = device_ids[0] IndexError: list index out of range
please help me!

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.