Coder Social home page Coder Social logo

keras-finetuning's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

keras-finetuning's Issues

AssertionError in dataset.py line 47

Hi,
when I run train.py on some test data I get the following error.
Any advise ?

Traceback (most recent call last):
  File "train.py", line 34, in <module>
    X, y, tags = dataset.dataset(data_directory, n)
  File "dataset.py", line 47, in dataset
    assert chan == 3

AssertionError

Won't start fine-tuning with tensorflow backend

Throws the following error as soon as the images are loaded:

image

Contents of keras.json:
{
"image_dim_ordering": "th",
"epsilon": 1e-07,
"floatx": "float32",
"backend": "tensorflow"
}

P.S. : Even tried replacing 'th' with 'tf', but I guess the part causing this error comes before any difference between 'th' and 'tf' can appear.

ValueError: NumpyArrayIterator is set to use the data format convention "channels_last"

ValueError: NumpyArrayIterator is set to use the data format convention "channels_last" (channels on axis 3), i.e. expected either 1, 3 or 4 channels on axis 3. However, it was passed an array with shape (80, 3, 224, 224) (224 channels).

I can load dataset and model successfully, but I can't find the answer online. I run the code in windows7, and I modify the code, so I don't know the reason. Is this a problem with data processing?

IOError: cannot identify image file

Hitting an error here when i run the script, going to have a look around now i think there is something wrong with pillow in my environment though i have tried to create a fresh env and im still hitting the same error!

Using TensorFlow backend. loading dataset Traceback (most recent call last): File "train.py", line 34, in <module> X, y, tags = dataset.dataset(data_directory, n) File "/Users/roryw10/keras-finetuning/dataset.py", line 45, in dataset img = scipy.misc.imread(filename) File "//anaconda/envs/finetune/lib/python2.7/site-packages/scipy/misc/pilutil.py", line 154, in imread im = Image.open(name) File "//anaconda/envs/finetune/lib/python2.7/site-packages/PIL/Image.py", line 1980, in open raise IOError("cannot identify image file") IOError: cannot identify image file

Got error on training

I got this error while running train.py file, I use Theano backend.

training the newly added dense layers
Epoch 1/20
Traceback (most recent call last):
File "train.py", line 134, in

File "/Users/justinushermawan/tensorflow/lib/python2.7/site-packages/keras/engine/training.py", line 1475, in fit_generator
class_weight=class_weight)
File "/Users/justinushermawan/tensorflow/lib/python2.7/site-packages/keras/engine/training.py", line 1244, in train_on_batch
check_batch_dim=True)
File "/Users/justinushermawan/tensorflow/lib/python2.7/site-packages/keras/engine/training.py", line 1000, in _standardize_user_data
check_loss_and_target_compatibility(y, self.loss_functions, self.internal_output_shapes)
File "/Users/justinushermawan/tensorflow/lib/python2.7/site-packages/keras/engine/training.py", line 196, in check_loss_and_target_compatibility
' while using as loss categorical_crossentropy. '
Exception: You are passing a target array of shape (3, 1) while using as loss categorical_crossentropy. categorical_crossentropy expects targets to be binary matrices (1s and 0s) of shape (samples, classes). If your targets are integer classes, you can convert them to the expected format via:

from keras.utils.np_utils import to_categorical
y_binary = to_categorical(y_int)

Alternatively, you can use the loss function sparse_categorical_crossentropy instead, which does expect integer targets.

NotImplementedError

When using the theano backend for running this code, the fine-tuning of the top layer runs perfectly fine. However, as soon as the tweaking of the penultimate layer starts, the following error is thrown:

image

I've tried running the code thrice on different data-sets (to make sure that it isn't a problem with corrupt,invalid data,etc.)

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.