Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fit_generator() error in tensorflow 2.4.0 but not in 2.0.0 #47

Open
wcycqjy opened this issue Apr 12, 2024 · 0 comments
Open

Fit_generator() error in tensorflow 2.4.0 but not in 2.0.0 #47

wcycqjy opened this issue Apr 12, 2024 · 0 comments

Comments

@wcycqjy
Copy link

wcycqjy commented Apr 12, 2024

Thank you for your work. I tried to run the project in tensorflow 2.4.0 as shown in the requirements.txt but the traceback shows when fitting:

result=AV_model.fit_generator(generator=train_generator,
                                 validation_data=val_generator,
                                 epochs=epochs,
                                 workers=workers,
                                 use_multiprocessing=MultiProcess,
                                 callbacks=[TensorBoard(log_dir='./log'), checkpoint, rlr],
                                 initial_epoch=0
                                 )
UserWarning: `Model.fit_generator` is deprecated and will be removed in a future version. Please use `Model.fit`, which supports generators.
  warnings.warn('`Model.fit_generator` is deprecated and '
Traceback (most recent call last):
  File "D:\Looking-to-Listen-at-the-Cocktail-Party-master\train.py", line 138, in <module>
    initial_epoch=initial_epoch
  File "D:\Anaconda3\envs\cocktail\lib\site-packages\tensorflow\python\keras\engine\training.py", line 1064, in fit
    steps_per_execution=self._steps_per_execution)
  File "D:\Anaconda3\envs\cocktail\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 1099, in __init__
    adapter_cls = select_data_adapter(x, y)
  File "D:\Anaconda3\envs\cocktail\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 964, in select_data_adapter
    _type_name(x), _type_name(y)))
ValueError: Failed to find data adapter that can handle input <class 'data_load.AVGenerator>, <class 'NoneType>'

I change AV_model.fit_generator() to AV_model.fit() and UserWarning disappears but the error is the same.

If I change tensorflow from 2.4.0 back to 2.0.3, codes can be run successfully. In this case, how to use tensorflow 2.4.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant