Coder Social home page Coder Social logo

Comments (19)

ylfzr avatar ylfzr commented on May 24, 2024 2

@themis0888, I think the problem should be you put your data into wrong place so the data actually is not fed into the model

from prototypical-networks-tensorflow.

abdulfatir avatar abdulfatir commented on May 24, 2024

Hi @mostoo45

How do I reproduce the issue?

from prototypical-networks-tensorflow.

mostoo45 avatar mostoo45 commented on May 24, 2024

Hi abdulfatir
Thank you first, I am studying your code.
I got the following error in In [7]:

ValueError: Variable encoder/conv_1/conv2d/kernel already exists, disallowed. Did you mean to set reuse=True in VarScope? Originally defined at:

File "", line 3, in conv_block
conv = tf.layers.conv2d(inputs, out_channels, kernel_size=3, padding='SAME')
File "", line 3, in encoder
net = conv_block(x, h_dim, name='conv_1')
File "", line 16, in
emb_x = encoder(tf.reshape(x, [num_classes * num_support, im_height, im_width, channels]), h_dim, z_dim)

so I added the following line.
tf.reset_default_graph()-->add line
x = tf.placeholder(tf.float32, [None, None, im_height, im_width, channels])
q = tf.placeholder(tf.float32, [None, None, im_height, im_width, channels])
x_shape = tf.shape(x)

from prototypical-networks-tensorflow.

mijung-kim avatar mijung-kim commented on May 24, 2024

@mostoo45 , I just ran this on my server and it worked flawless. FYI, I use tf 1.6

from prototypical-networks-tensorflow.

bdutta19 avatar bdutta19 commented on May 24, 2024

I have problems reproducing results too.. tried to reproduce these results but the loss value doesnt change. I thought it could be a initializer issue and tried a few different initializers but no dice. Also tried tf 1.3 and tf 1.6 neither of them converge.

from prototypical-networks-tensorflow.

mostoo45 avatar mostoo45 commented on May 24, 2024

Instead of ipynb, I use py.
By using py instead of ipynb, I got a loss and acc that is similar to the existing code.

from prototypical-networks-tensorflow.

bdutta19 avatar bdutta19 commented on May 24, 2024

Hi - are you CPU or GPUs .. I just tried by converting the code to a py file. below are the losses.. as you see they are not changing at all
also here is a gist of my py file proto-net-omniglot

I dont see anything wrong with the code so will keep looking..

(tf16) ➜ Experiments python proto-nets-omnoglot.py
(4112, 20, 28, 28)
2018-03-27 10:00:22.417629: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
[epoch 1/20, episode 50/100] => loss: 2.30259, acc: 0.10000
[epoch 1/20, episode 100/100] => loss: 2.30259, acc: 0.10000
[epoch 2/20, episode 50/100] => loss: 2.30259, acc: 0.10000
[epoch 2/20, episode 100/100] => loss: 2.30259, acc: 0.10000
[epoch 3/20, episode 50/100] => loss: 2.30259, acc: 0.10000
[epoch 3/20, episode 100/100] => loss: 2.30259, acc: 0.10000
[epoch 4/20, episode 50/100] => loss: 2.30259, acc: 0.10000
[epoch 4/20, episode 100/100] => loss: 2.30259, acc: 0.10000
[epoch 5/20, episode 50/100] => loss: 2.30259, acc: 0.10000
[epoch 5/20, episode 100/100] => loss: 2.30259, acc: 0.10000
[epoch 6/20, episode 50/100] => loss: 2.30259, acc: 0.10000
[epoch 6/20, episode 100/100] => loss: 2.30259, acc: 0.10000

from prototypical-networks-tensorflow.

mostoo45 avatar mostoo45 commented on May 24, 2024

I use both of them , tf 1.3 and python3

from prototypical-networks-tensorflow.

PytaichukBohdan avatar PytaichukBohdan commented on May 24, 2024

@mostoo45 Restarting the kernel with clearing an output worked for me

from prototypical-networks-tensorflow.

themis0888 avatar themis0888 commented on May 24, 2024

Same problem to me..
I ran Proto-MiniImagenet and I got followings
[epoch 93/100, episode 100/100] => loss: 2.99573, acc: 0.05000
[epoch 94/100, episode 50/100] => loss: 2.99573, acc: 0.05000
[epoch 94/100, episode 100/100] => loss: 2.99573, acc: 0.05000
[epoch 95/100, episode 50/100] => loss: 2.99573, acc: 0.05000
[epoch 95/100, episode 100/100] => loss: 2.99573, acc: 0.05000
[epoch 96/100, episode 50/100] => loss: 2.99573, acc: 0.05000
[epoch 96/100, episode 100/100] => loss: 2.99573, acc: 0.05000
[epoch 97/100, episode 50/100] => loss: 2.99573, acc: 0.05000
[epoch 97/100, episode 100/100] => loss: 2.99573, acc: 0.05000
[epoch 98/100, episode 50/100] => loss: 2.99573, acc: 0.05000
[epoch 98/100, episode 100/100] => loss: 2.99573, acc: 0.05000
[epoch 99/100, episode 50/100] => loss: 2.99573, acc: 0.05000
[epoch 99/100, episode 100/100] => loss: 2.99573, acc: 0.05000
[epoch 100/100, episode 50/100] => loss: 2.99573, acc: 0.05000
[epoch 100/100, episode 100/100] => loss: 2.99573, acc: 0.05000

same accuracy for every episode.
And weird thing is that this wasn't happening for Proto-Omniglot.
My tensorflow is for GPU and version 1.3

from prototypical-networks-tensorflow.

abdulfatir avatar abdulfatir commented on May 24, 2024

Many people are facing this issue. Can someone look into it?

from prototypical-networks-tensorflow.

themis0888 avatar themis0888 commented on May 24, 2024

@guohan950106 Hello~ this is the student who faced this issue #1.
Actually, I didn't face that problem anymore after that day. I did nothing but it just suddenly gone, so I could not figure out what was the problem.
Maybe you can reimplement this on your own to solve this problem.

from prototypical-networks-tensorflow.

ankishb avatar ankishb commented on May 24, 2024

@abdulfatir
I am facing same issue, this is output after running your code:

[[epoch 1/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 1/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 2/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 2/20, episode 100/100] => loss: 4.09434, acc: 0.01667
^L[epoch 3/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 3/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 4/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 4/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 5/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 5/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 6/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 6/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 7/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 7/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 8/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 8/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 9/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 9/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 10/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 10/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 11/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 11/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 12/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 12/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 13/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 13/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 14/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 14/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 15/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 15/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 16/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 16/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 17/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 17/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 18/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 18/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 19/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 19/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 20/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 20/20, episode 100/100] => loss: 4.09434, acc: 0.01667

I found that problem is that, gradient is not flowing backward. It is zero at each step.

Did you find any solution? Any sugestion?

from prototypical-networks-tensorflow.

NanYoMy avatar NanYoMy commented on May 24, 2024

awesome job!

from prototypical-networks-tensorflow.

sebastianpinedaar avatar sebastianpinedaar commented on May 24, 2024

@abdulfatir
I am facing same issue, this is output after running your code:

[[epoch 1/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 1/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 2/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 2/20, episode 100/100] => loss: 4.09434, acc: 0.01667
^L[epoch 3/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 3/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 4/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 4/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 5/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 5/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 6/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 6/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 7/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 7/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 8/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 8/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 9/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 9/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 10/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 10/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 11/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 11/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 12/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 12/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 13/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 13/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 14/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 14/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 15/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 15/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 16/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 16/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 17/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 17/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 18/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 18/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 19/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 19/20, episode 100/100] => loss: 4.09434, acc: 0.01667
[epoch 20/20, episode 50/100] => loss: 4.09434, acc: 0.01667
[epoch 20/20, episode 100/100] => loss: 4.09434, acc: 0.01667

I found that problem is that, gradient is not flowing backward. It is zero at each step.

Did you find any solution? Any sugestion?

I found that what @ylfzr mentioned is the issue. I was getting the same numbers. It turns out that managing the folders in Colab can be a little messy and if you don't pay attention you can miss the right data location (it was my case).

from prototypical-networks-tensorflow.

wdayang avatar wdayang commented on May 24, 2024

I also faced the problem with acc and loss unchanged

from prototypical-networks-tensorflow.

wdayang avatar wdayang commented on May 24, 2024

@themis0888, I think the problem should be you put your data into wrong place so the data actually is not fed into the model

Yes, after managed the the place of the data. the acc and loss changes

from prototypical-networks-tensorflow.

ali7amdi avatar ali7amdi commented on May 24, 2024

@themis0888, I think the problem should be you put your data into wrong place so the data actually is not fed into the model

Yes, after managed the the place of the data. the acc and loss changes

Hi @wdayang
How did you manage the place of the data to have the acc and loss changing?

from prototypical-networks-tensorflow.

HonFii avatar HonFii commented on May 24, 2024

If your acc and loss did not change at all after multiple episodes, it is most likely due to your dataset being misplaced. The correct location should be: prototypical-networks-tensorflow-master\data\omniglot\data\Alphabet_of_the_Magi, ,,,,, blah blah blah

[epoch 1/20, episode 5/100] => loss: 3.60291, acc: 0.43667
[epoch 1/20, episode 10/100] => loss: 3.25432, acc: 0.55667
[epoch 1/20, episode 15/100] => loss: 3.09199, acc: 0.57333
[epoch 1/20, episode 20/100] => loss: 2.91092, acc: 0.60333
[epoch 1/20, episode 25/100] => loss: 2.78092, acc: 0.59000
[epoch 1/20, episode 30/100] => loss: 2.63616, acc: 0.62667
[epoch 1/20, episode 35/100] => loss: 2.50083, acc: 0.61333
[epoch 1/20, episode 40/100] => loss: 2.40846, acc: 0.69000
[epoch 1/20, episode 45/100] => loss: 2.27202, acc: 0.72667
[epoch 1/20, episode 50/100] => loss: 2.05044, acc: 0.79000
[epoch 1/20, episode 55/100] => loss: 2.03263, acc: 0.78667
[epoch 1/20, episode 60/100] => loss: 1.90013, acc: 0.79667
[epoch 1/20, episode 65/100] => loss: 1.90940, acc: 0.74000
[epoch 1/20, episode 70/100] => loss: 1.69886, acc: 0.80333
[epoch 1/20, episode 75/100] => loss: 1.66013, acc: 0.81000
[epoch 1/20, episode 80/100] => loss: 1.66992, acc: 0.83333

from prototypical-networks-tensorflow.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.