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
Getting some kind of AttributeError #130
Comments
How does your params dictionary look like? |
This is how I have my parameter setup. |
There seems to be something going on with the input data. Can you get the shape of your input data and give a few rows of 'y' as an example. |
So I am doing text classification using embedding layers. Data are all numpy.ndarray format. |
Any feedback? |
This can't be the actual y format:
Can you share the actual python format for the 'y' you input to the model. |
print(np.array(y_label)) The format is a np.array. |
Maybe related with the data being passed to the input model. Can you share your input model and also the Scan() command. |
def create_model(X_train, X_dev, X_test, y_label, y_dev, Test_label, vocab_size,MAXLEN, params):
|
talos.utils.exceptions.TalosReturnError: Make sure that input model returns 'out, model' where out is history object from model.fit() So i edited somethings now i am getting this error! |
@Liquidten it be great if you could explain what you edited as have also encountered the |
Very sorry for not coming back to this. Thanks a lot for all the inputs also. @DrappierTechnologies can you also share your model, Scan() command, param dictionary and indication for your input data. |
Here you go and thanks for the prompt response:
Listing all this out has helped me visualize the issue and I seem to think I have found the cause. The issue is indeed with talos as talos doesn't seem to be able to flatten the pandas Series object y_train. Sending y_train as y_train.values flattens the Series to a 1D ndarray which talos is happy accepting. Do you know if passing a pandas Series is in fact not supported by talos or could this be that I have an older version of the library loaded? In any case now I'm receiving this error:
I'd be happy to create a separate issue so that you can close this one. |
Sorry guys, this slipped through the cracks. @Liquidten Did you end up getting things working? @DrappierTechnologies yes, these two are separate issues, could you post a new one with yours. In the meantime, I also suggest installing the current dev or daily-dev versions which are v.0.4.6 as many things have been improved in terms of how error-prone Talos is. |
I believe that these issues are resolved in the latest versions (> v0.4.4). Closing here. Feel free to reopen / create new issue if anything. |
Hi, Sorry for reopening this issue, but I'm finding the same error. I was trying to replicate the Comprehensive example when the error popped-up. My talos version is 0.4.5. Here is the complete error:
|
This is resolved in #185. Since v.0.4.7 the notebook is fixed. |
I had the same issue as OP. A Pandas DataFrame or Series contains a raw numpy array in the I believe Keras does this automatically if you pass a Pandas object. |
If your data is in the form |
Yes, that's what I did. But if talos is meant to be used with Keras models, and Keras unwraps Pandas objects automatically, then maybe talos should do the same thing. Just a thought. Since Pandas is widely used, I don't think we're the first ones to encounter this error. |
Traceback (most recent call last):
File "talosHyper.py", line 200, in
experiment_no='1')
File "/usr/local/lib/python3.6/dist-packages/talos/scan/Scan.py", line 166, in init
self._null = self.runtime()
File "/usr/local/lib/python3.6/dist-packages/talos/scan/Scan.py", line 170, in runtime
self = scan_prepare(self)
File "/usr/local/lib/python3.6/dist-packages/talos/scan/scan_prepare.py", line 62, in scan_prepare
self.last_neuron = last_neuron(self)
File "/usr/local/lib/python3.6/dist-packages/talos/utils/last_neuron.py", line 3, in last_neuron
labels = list(set(self.y.flatten('F')))
File "/usr/local/lib/python3.6/dist-packages/pandas/core/generic.py", line 4376, in getattr
return object.getattribute(self, name)
AttributeError: 'Series' object has no attribute 'flatten'
The text was updated successfully, but these errors were encountered: