Giter VIP home page Giter VIP logo

codemixedsentimentdetection's People

Contributors

jlbrem avatar joshinhj avatar kyungjunlee avatar utkarshdevd avatar

Watchers

 avatar  avatar  avatar  avatar

codemixedsentimentdetection's Issues

TypeError: cross_entropy_loss(): argument 'input' (position 1) must be Tensor, not tuple

when i am trying to run this block of code:

print("-"*50)
print("Running LSTM, One Hot Embeddings, Untrainable")

config = {
    "NAME": "LSTM_OneHot_Untrainable",
    "N_EPOCHS": 1,
    "EMB_TRAIN": False,
    "N_VOCAB": len(text_field.vocab.itos),
    "N_EMBED" : len(text_field.vocab.itos),
    "N_HIDDEN" : 512,
    "N_OUTPUT" : 3,
    "N_LAYERS" : 2,
    "LR": 0.001
}
model = OneHotLSTM(config)
pp.pprint(config)
print("-"*50)
run_loop(model, config)
print("-"*50)
print("END TRAINING")
print("-"*50)
print("START TESTING")
print("-"*50)
test(model, config)
print("-"*50)
print("END TESTING")
print("-"*50)

this error is showing:

--------------------------------------------------
Running LSTM, One Hot Embeddings, Untrainable
{   'EMB_TRAIN': False,
    'LR': 0.001,
    'NAME': 'LSTM_OneHot_Untrainable',
    'N_EMBED': 899,
    'N_EPOCHS': 1,
    'N_HIDDEN': 512,
    'N_LAYERS': 2,
    'N_OUTPUT': 3,
    'N_VOCAB': 899}
--------------------------------------------------
BEGIN TRAINING
--------------------------------------------------
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-34-f17180894fb6> in <module>()
     16 pp.pprint(config)
     17 print("-"*50)
---> 18 run_loop(model, config)
     19 print("-"*50)
     20 print("END TRAINING")

4 frames
/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py in cross_entropy(input, target, weight, size_average, ignore_index, reduce, reduction)
   2822     if size_average is not None or reduce is not None:
   2823         reduction = _Reduction.legacy_get_string(size_average, reduce)
-> 2824     return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index)
   2825 
   2826 

TypeError: cross_entropy_loss(): argument 'input' (position 1) must be Tensor, not tuple

Any help is appreciated and please tell the requirements for pytorch version

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.