WayneDW / Sentiment-Analysis-in-Event-Driven-Stock-Price-Movement-Prediction

Use NLP to predict stock price movement associated with news
http://goldenrocks.me/
MIT License
800 stars 294 forks source link

issue with AttributeError: 'float' object has no attribute 'item' #15

Closed kkinlee closed 6 years ago

kkinlee commented 6 years ago

Hi,

I encounter this problem when running main.py:

File "C:\Users\Documents\Python Scripts\Sentiment-Analysis-in-Event-Driven-Stock-Price-Movement-Prediction-master\util.py", line 31, in set_scale = [parameter.data.std().item() for parameter in model.parameters()]

AttributeError: 'float' object has no attribute 'item'

error seems to came from util.py

Any idea on how to solve it?

Cheers

WayneDW commented 6 years ago

You are probably using older version of Pytorch

kkinlee commented 6 years ago

Thanks.