Giter Club home page Giter Club logo

auto-colorization-of-grayscale-image's Issues

index error: index 2 is out of bounds

The code is good and efficient. However I found some bugs probably due to usage of old python kernel (3.6.9). I am not sure. I got two errors when compiling this code:

  1. loaded_model needs to be compiled first before using it.
    Solution: It is a temporary solution. I loaded the model in the last line of code instead after saving the model code line and before the test routine. The proper solution will be to compile the loaded_model.
    add the following code:
    # evaluate loaded model on test data loaded_model.compile(optimizer='rmsprop', loss='mse', metrics = ['accuracy']) score = loaded_model.evaluate(Xtest, Ytest, verbose=0) print("%s: %.2f%%" % (loaded_model.metrics_names[1], score[1]*100))

  2. This error occurs at the line where images of test and prediction are to be plotted. (originally last line of code)

IndexError                                Traceback (most recent call last)
<ipython-input-27-e8239560eb56> in <module>
     7 for filename in os.listdir('Dataset/Test/'):
     8         colorize.append(img_to_array(load_img('Dataset/Test/'+filename)))
----> 9         ax[row,0].imshow(load_img('Dataset/Test/'+filename), interpolation='nearest')
    10         row +=1
    11 

IndexError: index 2 is out of bounds for axis 0 with size 2

I have no clue yet how to solve it.

Running The Code

I tried to run the program on Google Colab but I got an error like:

FileNotFoundError: [Errno 2] No such file or directory: 'Dataset/Train/'

How can I run the program?

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.