Giter Site home page Giter Site logo

Comments (2)

olgabrinza avatar olgabrinza commented on June 15, 2024

Hello, @stratospark !
I have an issue using flow_from_directory option to create a generator. When i'm tying to fit my model with the fit_generator(like this) model.fit_generator( train_generator, steps_per_epoch=samples_per_epoch, epochs=50, validation_data=validation_generator, callbacks=None, validation_steps=validation_steps)

i have theTypeError: process() missing 1 required positional argument : 'rng'

The fool error looks likee:

`TypeError Traceback (most recent call last)
in ()
5 validation_data=validation_generator,
6 callbacks=None,
----> 7 validation_steps=validation_steps)

/usr/local/lib/python3.5/dist-packages/keras/legacy/interfaces.py in wrapper(*args, **kwargs)
89 warnings.warn('Update your ' + object_name + 90 ' call to the Keras 2 API: ' + signature, stacklevel=2)
---> 91 return func(*args, **kwargs)
92 wrapper._original_function = func
93 return wrapper

/usr/local/lib/python3.5/dist-packages/keras/engine/training.py in fit_generator(self, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch)
2190 batch_index = 0
2191 while steps_done < steps_per_epoch:
-> 2192 generator_output = next(output_generator)
2193
2194 if not hasattr(generator_output, 'len'):

/usr/local/lib/python3.5/dist-packages/keras/utils/data_utils.py in get(self)
791 success, value = self.queue.get()
792 if not success:
--> 793 six.reraise(value.class, value, value.traceback)

~/.local/lib/python3.5/site-packages/six.py in reraise(tp, value, tb)
691 if value.traceback is not tb:
692 raise value.with_traceback(tb)
--> 693 raise value
694 finally:
695 value = None

/usr/local/lib/python3.5/dist-packages/keras/utils/data_utils.py in _data_generator_task(self)
656 # => Serialize calls to
657 # infinite iterator/generator's next() function
--> 658 generator_output = next(self._generator)
659 self.queue.put((True, generator_output))
660 else:

~/photo_data/tools/image_gen_extended.py in next(self, *args, **kwargs)
664
665 def next(self, *args, **kwargs):
--> 666 return self.next(*args, **kwargs)
667
668 def process_image_worker(tup):

~/photo_data/tools/image_gen_extended.py in next(self)
903 if x.ndim == 2:
904 x = np.expand_dims(x, axis=0)
--> 905 x = self.image_data_generator.process(x)
906 if i == 0:
907 batch_x = np.zeros((current_batch_size,) + x.shape)

TypeError: process() missing 1 required positional argument: 'rng'`

Thank you in advance for your help!

from food-101-keras.

fvisconti avatar fvisconti commented on June 15, 2024

Hello, @stratospark !
I have an issue using flow_from_directory option to create a generator. When i'm tying to fit my model with the fit_generator(like this) model.fit_generator( train_generator, steps_per_epoch=samples_per_epoch, epochs=50, validation_data=validation_generator, callbacks=None, validation_steps=validation_steps)

i have theTypeError: process() missing 1 required positional argument : 'rng'

Hi, I had the same issue.
rng in image_gen_extended.py is just a random number generator: if you just set globally:

rng = np.random

everything should work.

from food-101-keras.

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.