Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing 1 required positional argument: 'units' ann.py rnn #36

Open
EricBollar opened this issue Dec 28, 2020 · 2 comments
Open

missing 1 required positional argument: 'units' ann.py rnn #36

EricBollar opened this issue Dec 28, 2020 · 2 comments

Comments

@EricBollar
Copy link

Hi, I have been trying to set this up and I receive this error after running the script in the readme. Please let me know how to fix; I am not very familiar with python. Thanks!

File "main.py", line 16, in
rnn = RNN([1, 100, 100, 1]) # number of neurons in each layer
File "/usr/local/lib/python3.7/site-packages/bulbea-0.1.0-py3.7.egg/bulbea/learn/models/ann.py", line 29, in init
TypeError: init() missing 1 required positional argument: 'units'

The whole script:

import bulbea as bb
share = bb.Share('WIKI', 'GOOGL')
share.data

from bulbea.learn.evaluation import split
Xtrain, Xtest, ytrain, ytest = split(share, 'Close', normalize = True)

import numpy as np
Xtrain = np.reshape(Xtrain, (Xtrain.shape[0], Xtrain.shape[1], 1))
Xtest = np.reshape(Xtest, (Xtest.shape[0], Xtest.shape[1], 1))

from bulbea.learn.models import RNN
rnn = RNN([1, 100, 100, 1]) # number of neurons in each layer
rnn.fit(Xtrain, ytrain)

from sklearn.metrics import mean_squared_error
p = rnn.predict(Xtest)
mean_squared_error(ytest, p)

import matplotlib.pyplot as pplt
pplt.plot(ytest)
pplt.plot(p)
pplt.show()

alexwang2013 added a commit to alexwang2013/bulbea that referenced this issue Jan 17, 2021
missing 1 required positional argument: 'units' ann.py rnn
alexwang2013 added a commit to alexwang2013/bulbea that referenced this issue Jan 17, 2021
missing 1 required positional argument: 'units' ann.py rnn
@vickyxu2333
Copy link

Hi, I met the same problem as u. I have tried many methods to solve it but I failed. Did u solve it finally?

@mochman
Copy link

mochman commented Feb 26, 2021

I had the same issue. I was able to work around it by modifying the ann.py script.
I changes all occurrences of output_dim to units.
Then you have to reinstall bulbea by running python setup.py install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants