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

ValueError: Optimizer weight shape (6,) not compatible with provided weight shape (800, 6) #3

Open
ShreyaKhare opened this issue Sep 29, 2017 · 39 comments

Comments

@ShreyaKhare
Copy link

I get this error when i try to load an existing model.

@nikicc
Copy link
Owner

nikicc commented Sep 29, 2017

Can you please paste the whole stack trace? Also are you on Keras version 1?

@ShreyaKhare
Copy link
Author

ShreyaKhare commented Oct 3, 2017

Can you specifiy tensorflow and keras version that was used for training

@nikicc
Copy link
Owner

nikicc commented Oct 9, 2017

We only used Theano, no Tensorflow. I think most experiments were run on Theano 0.8.2.

@ghost
Copy link

ghost commented Feb 26, 2018

I have Keras installed. Can I use Keras here to implement the codes?

@nikicc
Copy link
Owner

nikicc commented Feb 26, 2018

Can I use Keras here to implement the codes?

@HangsunKim not sure I understand the question. You need keras==1.1.0 and pandas installed, as stated in requirements.txt. After that, you should be able to run the code. Check the example of usage.

@ghost
Copy link

ghost commented Feb 26, 2018

@nikicc Thanks for your reply. I have the pandas and keras library installed. I've always done deep learning by importing keras, as tensforflow as the backend. I think then I'll be able to run the codes then. I asked this question because you somewhere indicated that the codes are run on theano. That was my concern.

@nikicc
Copy link
Owner

nikicc commented Feb 26, 2018

I asked this question because you somewhere indicated that the codes are run on theano.

Yes, the models were trained using Keras with Theano backend. I'm not sure if the models can be loaded and used with Tensorflow for not. Let me know if this will work for you on Tensorflow.

@ghost
Copy link

ghost commented Feb 27, 2018

@nikicc I'm trying to run the demo codes with Theano as backend.
I found a way to change the backend engine easily from Tensorflow to Theano.
But, when I run the first line of codes.
I get this error, ImportError: No module named html

Do you know what could be wrong and how I could fix this? Thanks in advance.

@nikicc
Copy link
Owner

nikicc commented Feb 27, 2018

I get this error, ImportError: No module named html

Are you sure you're on Python 3? html is a standard Python's library.

@ghost
Copy link

ghost commented Feb 27, 2018

@nikicc Oh, I was using python 2.7. Okay, so I tried on python 3.6, but now I get the
error ModuleNotFoundError: No module named 'theano'.
Do I just do "pip install theano" in my command prompt?

@nikicc
Copy link
Owner

nikicc commented Feb 27, 2018

Do I just do "pip install theano" in my command prompt?

To be sure, use the same version of Theano that I did: pip install theano==0.8.2 should do it.

@ghost
Copy link

ghost commented Feb 27, 2018

@nikicc Thanks, I installed theano 0.8.2 but now I get the below error. Are you familiar with this error?
. collect2.exe: error: ld returned 1 exit status status=1): C:\Users\Anaconda3\libs/python36.lib: error adding symbols: File in wrong format

@nikicc
Copy link
Owner

nikicc commented Feb 27, 2018

@HangsunKim no idea what that error is about, sorry.

@ghost
Copy link

ghost commented Feb 27, 2018

@nikicc It's okay.. I'm in Python 3.6. May I know which python version you are using? Thanks.

@nikicc
Copy link
Owner

nikicc commented Feb 27, 2018

I think I was on 3.6 as well.

@ghost
Copy link

ghost commented Feb 28, 2018

I now get this error.
ValueError: Tensor conversion requested dtype int32 for Tensor with dtype float32: 'Tensor("embedding_1/random_uniform:0", shape=(412, 25), dtype=float32)'
I was wondering if you know this error.
I referred to
keras-team/keras#7460.
However, there's no clear solution to it..

@nikicc
Copy link
Owner

nikicc commented Feb 28, 2018

Don't know. Are you sure you are on keras==1.1.0?

@SidShenoy
Copy link

Hey! @HangsunKim Finally solved this issue. Follow these steps:

  1. Only install the packages mentioned in requirements.txt (with the exact same versions) and no other package (like tensorflow). Uninstall tensorflow if already installed.

  2. Change the backend of 'keras' from 'tensorflow' to 'theano'. Instructions to do this have been mentioned on the 'keras' website (https://keras.io/backend/):

image

Cheers!

@nikicc
Copy link
Owner

nikicc commented Mar 29, 2018

@SidShenoy thanks for posting this!

@jhaozz
Copy link

jhaozz commented Apr 12, 2018

I couldn't install the version, any problem? it says 'could not find a version that satisfies the requirement emotion_predictor (from versions: ) No matching distribution found for emotion_predictor.'

@venkatshan707
Copy link

sir please give where i want to run the following code : in jupiter notebook or anaconda prompt

@venkatshan707
Copy link

these codes:

from emotion_predictor import EmotionPredictor

model = EmotionPredictor(classification='ekman', setting='mc')

tweets = [
"Watching the sopranos again from start to finish!",
"Finding out i have to go to the dentist tomorrow",
"I want to go outside and chalk but I have no chalk",
"I HATE PAPERS AH #AH #HATE",
"My mom wasn't mad",
"Do people have no Respect for themselves or you know others peoples homes",
]

@venkatshan707
Copy link

screenshot 320
screenshot 321

@venkatshan707
Copy link

i got those errors while running through jupitter notebook

@nikicc
Copy link
Owner

nikicc commented Feb 17, 2019

@venkatshan707 seem like the issue is in the backend your Keras is trying to use. According to the above screenshots your Keras wants to invoke a tensorflow backend, while you will need to use theano backend to use the emotion predictiors from this repository. More precisely, you'll need theano==0.8.2 (see the requirements file). Check this page in the Keras documentation to figure out how to switch to theano backend.

@venkatshan707
Copy link

venkatshan707 commented Feb 17, 2019 via email

@nikicc
Copy link
Owner

nikicc commented Feb 17, 2019

@venkatshan707 if you set the backend up, then you should be able to start the code either from Jupiter or python script. What is the error you are seeing now after the backend has been set?

Sorry but I don't have any user manual I could share with you.

@venkatshan707
Copy link

sir ,can you please help me with teamviewer .

@venkatshan707
Copy link

just 10 mins

@nikicc
Copy link
Owner

nikicc commented Feb 19, 2019

@venkatshan707 I think it's easier if we keep the communication here. What is the error you are seeing now?

@drcs8283
Copy link

how to import emotion predicator module...

@nikicc
Copy link
Owner

nikicc commented Mar 16, 2020

@Mounika2825
Copy link

how to import emotion predicator module...
i found this error while importing
ModuleNotFoundError: No module named 'emotion_predictor'

@nikicc
Copy link
Owner

nikicc commented Mar 17, 2020

@Mounika2825 are you in the correct folder when executing your code? The example assumes you are in the same folder where the emotion_predictor.py file is.

@Mounika2825
Copy link

@nikicc Thanks a lot.. i executed the code.... Can i get accuracy by using this code ?

@Mounika2825
Copy link

how can i implement this code in google colab?

@nikicc
Copy link
Owner

nikicc commented Mar 18, 2020

@Mounika2825 the current code does not support calculating the accuracy. You would need to implement that yourself. Also, not sure about the google colab.

@Mounika2825
Copy link

How can i get accuracy by using models of unison

@nikicc
Copy link
Owner

nikicc commented Mar 19, 2020

@Mounika2825 not sure which accuracy are you interested in. If you want to know the accuracy of the models as we estimated it, look at the paper for more details; but approximately the accuracy is around 70%. If you want to know the accuracy of the model on your own data set, then you'd need to calculate that yourself.

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

7 participants