Git Product home page Git Product logo

Comments (1)

Hammadmacho7 avatar Hammadmacho7 commented on July 30, 2024

I have solved this issue after many hours. However, I am facing a new issue when I execute this 'history = model.fit(train_generator, shuffle =True,
epochs=50, workers=4, use_multiprocessing=True,
validation_data = test_generator,
verbose = 1, callbacks = callbacks)':

Epoch 1/50

RemoteTraceback Traceback (most recent call last)

RemoteTraceback:
"""
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/Users/hammadmacho7/PycharmProjects/myvenv/lib/python3.7/site-packages/keras/utils/data_utils.py", line 406, in get_index
return _SHARED_SEQUENCES[uid][i]
File "/var/folders/q2/2l3cmy9d7ws6npzjdp68gcbm0000gn/T/ipykernel_1566/3242875180.py", line 54, in getitem
augmented = self.augmentation(self.image_size)(image= X_sample, mask= y_sample)
File "/Users/hammadmacho7/PycharmProjects/myvenv/lib/python3.7/site-packages/albumentations/core/composition.py", line 205, in call
data = t(force_apply=force_apply, **data)
File "/Users/hammadmacho7/PycharmProjects/myvenv/lib/python3.7/site-packages/albumentations/core/transforms_interface.py", line 95, in call
return self.apply_with_params(params, **kwargs)
File "/Users/hammadmacho7/PycharmProjects/myvenv/lib/python3.7/site-packages/albumentations/core/transforms_interface.py", line 110, in apply_with_params
res[key] = target_function(arg, **dict(params, **target_dependencies))
File "/Users/hammadmacho7/PycharmProjects/myvenv/lib/python3.7/site-packages/albumentations/augmentations/transforms.py", line 1573, in apply
return F.brightness_contrast_adjust(img, alpha, beta, self.brightness_by_max)
File "/Users/hammadmacho7/PycharmProjects/myvenv/lib/python3.7/site-packages/albumentations/augmentations/functional.py", line 1293, in brightness_contrast_adjust
return _brightness_contrast_adjust_non_uint(img, alpha, beta, beta_by_max)
File "/Users/hammadmacho7/PycharmProjects/myvenv/lib/python3.7/site-packages/albumentations/augmentations/functional.py", line 143, in wrapped_function
return clip(func(img, *args, **kwargs), dtype, maxval)
File "/Users/hammadmacho7/PycharmProjects/myvenv/lib/python3.7/site-packages/albumentations/augmentations/functional.py", line 1261, in _brightness_contrast_adjust_non_uint
max_value = MAX_VALUES_BY_DTYPE[dtype]
KeyError: dtype('float64')
"""

The above exception was the direct cause of the following exception:

KeyError Traceback (most recent call last)

/var/folders/q2/2l3cmy9d7ws6npzjdp68gcbm0000gn/T/ipykernel_1566/3851635057.py in
2 epochs=50, workers=4, use_multiprocessing=True,
3 validation_data = test_generator,
----> 4 verbose = 1, callbacks = callbacks)
5 #plotting history
6 plot_training_history(history)

~/PycharmProjects/myvenv/lib/python3.7/site-packages/keras/engine/training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, validation_freq, max_queue_size, workers, use_multiprocessing, **kwargs)
1145 use_multiprocessing=use_multiprocessing,
1146 shuffle=shuffle,
-> 1147 initial_epoch=initial_epoch)
1148
1149 # Case 2: Symbolic tensors or Numpy array-like.

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

~/PycharmProjects/myvenv/lib/python3.7/site-packages/keras/engine/training.py in fit_generator(self, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, validation_freq, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch)
1730 use_multiprocessing=use_multiprocessing,
1731 shuffle=shuffle,
-> 1732 initial_epoch=initial_epoch)
1733
1734 @interfaces.legacy_generator_methods_support

~/PycharmProjects/myvenv/lib/python3.7/site-packages/keras/engine/training_generator.py in fit_generator(model, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, validation_freq, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch)
183 batch_index = 0
184 while steps_done < steps_per_epoch:
--> 185 generator_output = next(output_generator)
186
187 if not hasattr(generator_output, 'len'):

~/PycharmProjects/myvenv/lib/python3.7/site-packages/keras/utils/data_utils.py in get(self)
623 except Exception:
624 self.stop()
--> 625 six.reraise(*sys.exc_info())
626
627

~/PycharmProjects/myvenv/lib/python3.7/site-packages/six.py in reraise(tp, value, tb)
717 if value.traceback is not tb:
718 raise value.with_traceback(tb)
--> 719 raise value
720 finally:
721 value = None

~/PycharmProjects/myvenv/lib/python3.7/site-packages/keras/utils/data_utils.py in get(self)
608 try:
609 future = self.queue.get(block=True)
--> 610 inputs = future.get(timeout=30)
611 except mp.TimeoutError:
612 idx = future.idx

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/pool.py in get(self, timeout)
655 return self._value
656 else:
--> 657 raise self._value
658
659 def _set(self, i, obj):

KeyError: dtype('float64')

#PLEASE HELP

from ml-dl-scripts.

Related Issues (8)

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.