image-analogies
image-analogies copied to clipboard
ValueError: Layer weight shape (3, 3, 3, 64) not compatible with provided weight shape (64, 3, 3, 3)
Hi, I got the following message running the command, it seems to be the weight shape problem , any idea on solving it? thanks :
Traceback (most recent call last):
File "/usr/local/bin/make_image_analogy.py", line 27, in
I suspect you have keras 2 installed, but this only runs on v1. I need to update the versions in setup.py. To confirm, run pip show keras
.
Hi creator of project, yes, my keras version is 2.02
Hi @awentzonline, are you planning on supporting Keras 2 anytime soon? Is there a workaround for the time being?
Hi, I had the same question as above. I don't have a way to access anything below Keras 2 as I'm using a shared computing cluster. Any suggestions? Thanks!
@pmlantos What I have done is to use virtualenv
and instal Keras==1.1.1
on it. Not sure if that is feasible in your case.
Thanks, it may be ... I've set up a virtual environment with 1.2.1. Do I need to reinstall image-analogies in the virtual environment too?
On Apr 29, 2017 3:26 AM, "Ahmed Baracat" [email protected] wrote:
@pmlantos https://github.com/pmlantos What I have done is to use virtualenv and instal Keras==1.1.1 on it. Not sure if that is feasible in your case.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/awentzonline/image-analogies/issues/39#issuecomment-298152957, or mute the thread https://github.com/notifications/unsubscribe-auth/AajKY8OQ9Stizg_xb3WcUmOhiv7mjwOrks5r0uY-gaJpZM4M1bVy .
Unfortunately I can't get this package to run within a virtual environment, though setting the environment up seems straightforward. Wonder if I can find a way to cheaply do it on AWS.
That's what worked for me. Hope it helps.
- Activate the
virtualenv
- Check the version of keras installed using
pip show keras
- If it is Keras version 2 then
pip uninstall keras
followed bypip install keras==1.1.1
. - Uninstall image-analogies
- Reinstall image-analogies
Thanks, unfortunately doesn't work for me. Some of the installation has to go into shared parts of the computing cluster that I don't have access to. Appreciate the help though.
On Sun, Apr 30, 2017 at 5:37 AM, Ahmed Baracat [email protected] wrote:
That's what worked for me. Hope it helps.
- Activate the virtualenv
- Check the version of keras installed using pip show keras
- If it is Keras version 2 then pip uninstall keras followed by pip install keras==1.1.1.
- Uninstall image-analogies
- Reinstall image-analogies
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/awentzonline/image-analogies/issues/39#issuecomment-298222050, or mute the thread https://github.com/notifications/unsubscribe-auth/AajKY7SbYca6ke1ZGs0AHy1Wbm_dkBhfks5r1FZegaJpZM4M1bVy .
No worries, but I think that if you are using virtualenv
then you don't need to depend on shared parts because you get to create an isolated environment.
I have same problem as first
make sure that
requirements.txt
Cython==0.23.4 h5py==2.5.0 Keras==1.1.1 numpy==1.10.4 Pillow==3.1.1 PyYAML==3.11 scipy==0.17.0 scikit-learn==0.17.0 six==1.10.0 -e git://github.com/Theano/Theano.git@954c3816a40de172c28124017a25387f3bf551b2#egg=Theano
and I use sudo pip install theano==0.9.0b1
than it works~
and make sure that you have edit ~/.keras/keras.json like this { "image_dim_ordering": "th", "epsilon": 1e-07, "floatx": "float32", "backend": "theano" }
I have replaced the 94th line in image_analogy/vgg16.py with
weights[0] = np.transpose(np.array(weights[0])[:, :, ::-1, ::-1], (2, 3, 1, 0))
and it works like charm now.