KichangKim / DeepDanbooru

AI based multi-label girl image classification system, implemented by using TensorFlow.
MIT License
2.65k stars 260 forks source link

TypeError: ('Keyword argument not understood:', 'keepdims') When using Pretrained Model v3-20211112-sgd-e28 #53

Closed huang1332 closed 2 years ago

huang1332 commented 2 years ago

import deepdanbooru as dd 2022-02-04 16:44:56.755548: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cudart64_110.dll project_path=r'C:\0\DeepDanbooru\d20211112' compile_model=False model = dd.project.load_model_from_project(project_path, compile_model=compile_model ) Traceback (most recent call last): File "", line 1, in File "C:\0\pixiv2022\DeepDanbooru\deepdanbooru\project\project.py", line 44, in load_model_from_project model = tf.keras.models.load_model(model_path, compile=compile_model) File "C:\ProgramData\Miniconda3\envs\tf25\lib\site-packages\tensorflow\python\keras\saving\save.py", line 202, in load_model compile) File "C:\ProgramData\Miniconda3\envs\tf25\lib\site-packages\tensorflow\python\keras\saving\hdf5_format.py", line 181, in load_model_from_hdf5 custom_objects=custom_objects) File "C:\ProgramData\Miniconda3\envs\tf25\lib\site-packages\tensorflow\python\keras\saving\model_config.py", line 59, in model_from_config return deserialize(config, custom_objects=custom_objects) File "C:\ProgramData\Miniconda3\envs\tf25\lib\site-packages\tensorflow\python\keras\layers\serialization.py", line 163, in deserialize printable_module_name='layer') File "C:\ProgramData\Miniconda3\envs\tf25\lib\site-packages\tensorflow\python\keras\utils\generic_utils.py", line 672, in deserialize_keras_object list(custom_objects.items()))) File "C:\ProgramData\Miniconda3\envs\tf25\lib\site-packages\tensorflow\python\keras\engine\functional.py", line 669, in from_config config, custom_objects) File "C:\ProgramData\Miniconda3\envs\tf25\lib\site-packages\tensorflow\python\keras\engine\functional.py", line 1279, in reconstruct_from_config process_layer(layer_data) File "C:\ProgramData\Miniconda3\envs\tf25\lib\site-packages\tensorflow\python\keras\engine\functional.py", line 1261, in process_layer layer = deserialize_layer(layer_data, custom_objects=custom_objects) File "C:\ProgramData\Miniconda3\envs\tf25\lib\site-packages\tensorflow\python\keras\layers\serialization.py", line 163, in deserialize printable_module_name='layer') File "C:\ProgramData\Miniconda3\envs\tf25\lib\site-packages\tensorflow\python\keras\utils\generic_utils.py", line 675, in deserialize_keras_object deserialized_obj = cls.from_config(cls_config) File "C:\ProgramData\Miniconda3\envs\tf25\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 740, in from_config return cls(config) File "C:\ProgramData\Miniconda3\envs\tf25\lib\site-packages\tensorflow\python\keras\layers\pooling.py", line 1023, in init super(GlobalPooling2D, self).init(kwargs) File "C:\ProgramData\Miniconda3\envs\tf25\lib\site-packages\tensorflow\python\training\tracking\base.py", line 522, in _method_wrapper result = method(self, *args, **kwargs) File "C:\ProgramData\Miniconda3\envs\tf25\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 347, in init generic_utils.validate_kwargs(kwargs, allowed_kwargs) File "C:\ProgramData\Miniconda3\envs\tf25\lib\site-packages\tensorflow\python\keras\utils\generic_utils.py", line 1137, in validate_kwargs raise TypeError(error_message, kwarg) TypeError: ('Keyword argument not understood:', 'keepdims')

python==3.7.9 cuda==11.3 cudann=8.2.1 tensorflow-gpu==2.5.0 RTX 2080ti windows10

huang1332 commented 2 years ago

Tensorflow = = 2.6.0 should be used instead of tensorflow = = 2.5.0

rachmadaniHaryono commented 2 years ago

both requirements.txt and setup.py only require tensorflow>=2.3.1

https://github.com/KichangKim/DeepDanbooru/blob/master/setup.py https://github.com/KichangKim/DeepDanbooru/blob/master/requirements.txt

it is quite strange that 2.6.0 would fail

maybe if there is another issue like this set maximum requirement to exclude 2.6.0 @KichangKim ?

KichangKim commented 2 years ago

I'll update setup.py and requirements.txt.