Giter Site home page Giter Site logo

Comments (8)

titu1994 avatar titu1994 commented on June 14, 2024

You need to have the AVA.txt file, that matches in size and IDs to all the files in the train directory.

from neural-image-assessment.

arieszhang1994 avatar arieszhang1994 commented on June 14, 2024

Yes, In fact I have prepared the dataset and of course checked it.
This error was raised just after the final epoch, which means it should be over correctly but not raising this error

from neural-image-assessment.

titu1994 avatar titu1994 commented on June 14, 2024

Does your code stop execution or something ? It says exception ignored.

from neural-image-assessment.

arieszhang1994 avatar arieszhang1994 commented on June 14, 2024

yes it stopped execution and gave me the
IndexError: list index out of range
I think there is something wrong with the generator.
Btw, did you use python2 or python3?

from neural-image-assessment.

titu1994 avatar titu1994 commented on June 14, 2024

Python 3. See the data loading portion, and see if it loads as many files as you have in the directory. I have a feeling that since you are not loading the full ava dataset, it's getting a mismatched index for a file with the ava scores file.

from neural-image-assessment.

arieszhang1994 avatar arieszhang1994 commented on June 14, 2024

Hi titu1994!
Thank you so much for helping me.
In fact, I have rewrote the part of training with tensorflow instead of fit_generator.
At first it raised the similar problem, but I solved with the simple sess.close(). So think maybe this problem had some connection with the memory leak, which depends on version of keras and tensorflow

from neural-image-assessment.

liangjin2007 avatar liangjin2007 commented on June 14, 2024

Change the code from
with tf.Session() as sess:
****
sess.run(.initializer)
while(True):
****
to
with sess.graph.as_default():
****
sess.run(
*.initializer)
while(True):
****
And the new code's sess is K.get_session() as input parameter for the generator. This works fine for me.

from neural-image-assessment.

wudejian789 avatar wudejian789 commented on June 14, 2024

Thank you so much for your fantastic work!
I have just read you code and try to redo it again.
Then i just change the batch to 10, epochs to 2, and use the first 250 pics as training set and the last 50 as val set.
At the first, It seems to be fine.
But I get the Index error in the final epoch.
Exception ignored in: <generator object train_generator at 0x7f8c7433a360> Traceback (most recent call last): File "/home/haoyuzhang/workspace/NIMA_zhanghaoyu/utils/data_loader.py", line 123, in train_generator yield (X_batch, y_batch) File "/home/haoyuzhang/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1503, in __exit__ exec_type, exec_value, exec_tb) File "/usr/lib/python3.5/contextlib.py", line 77, in __exit__ self.gen.throw(type, value, traceback) File "/home/haoyuzhang/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 4342, in get_controller if self.stack[-1] is not default: IndexError: list index out of range
I know there is something wrong with keras.fit_generator but I can't figure it now.
Did some one else have the same situation?

Change the code from
''
with tf.Session() as sess
''
to
''
sess = tf.Session()
''
It will be OK. Very strange!

from neural-image-assessment.

Related Issues (20)

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.