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

Keras-Tensorflow version problem #3

Closed
yuanmu97 opened this issue Nov 13, 2019 · 14 comments
Closed

Keras-Tensorflow version problem #3

yuanmu97 opened this issue Nov 13, 2019 · 14 comments

Comments

@yuanmu97
Copy link

I met some problems while executing 'load_model' function.
My env:
python==3.6
tensorflow==1.4.0
keras==2.0.8

Error:
ValueError Traceback (most recent call last)
in
----> 1 model = load_model("action_net_ex-060_acc-0.745313.h5")

ValueError: Unknown initializer: GlorotUniform

Could you please specify your testing versions of tf and keras?
Thanks!

@ucasiggcas
Copy link

hello ,dear
I have the same question now ,have you solved the problem ?
Could you help me ?please.
thx

@ucasiggcas
Copy link

tf=1.14,keras=2.2.4

@yuanmu97
Copy link
Author

Yeah, the problem has been solved by the env:
tensorflow=1.14.0
keras=2.3.1
imageai=2.1.5

@ucasiggcas
Copy link

thanks ,
but I can't


    model=load_model('./orgdata/models/action_net_ex-060_acc-0.745313.h5')
  File "D:\python\lib\site-packages\keras\engine\saving.py", line 492, in load_wrapper
    return load_function(*args, **kwargs)
  File "D:\python\lib\site-packages\keras\engine\saving.py", line 584, in load_model
    model = _deserialize_model(h5dict, custom_objects, compile)
  File "D:\python\lib\site-packages\keras\engine\saving.py", line 274, in _deserialize_model
    model = model_from_config(model_config, custom_objects=custom_objects)
  File "D:\python\lib\site-packages\keras\engine\saving.py", line 627, in model_from_config
    return deserialize(config, custom_objects=custom_objects)
  File "D:\python\lib\site-packages\keras\layers\__init__.py", line 168, in deserialize
    printable_module_name='layer')
  File "D:\python\lib\site-packages\keras\utils\generic_utils.py", line 147, in deserialize_keras_object
    list(custom_objects.items())))
  File "D:\python\lib\site-packages\keras\engine\network.py", line 1056, in from_config
    process_layer(layer_data)
  File "D:\python\lib\site-packages\keras\engine\network.py", line 1042, in process_layer
    custom_objects=custom_objects)
  File "D:\python\lib\site-packages\keras\layers\__init__.py", line 168, in deserialize
    printable_module_name='layer')
  File "D:\python\lib\site-packages\keras\utils\generic_utils.py", line 149, in deserialize_keras_object
    return cls.from_config(config['config'])
  File "D:\python\lib\site-packages\keras\engine\base_layer.py", line 1179, in from_config
    return cls(**config)
  File "D:\python\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "D:\python\lib\site-packages\keras\layers\convolutional.py", line 484, in __init__
    **kwargs)
  File "D:\python\lib\site-packages\keras\layers\convolutional.py", line 117, in __init__
    self.kernel_initializer = initializers.get(kernel_initializer)
  File "D:\python\lib\site-packages\keras\initializers.py", line 515, in get
    return deserialize(identifier)
  File "D:\python\lib\site-packages\keras\initializers.py", line 510, in deserialize
    printable_module_name='initializer')
  File "D:\python\lib\site-packages\keras\utils\generic_utils.py", line 140, in deserialize_keras_object
    ': ' + class_name)
ValueError: Unknown initializer: GlorotUniform
>>> keras.__version__
'2.3.1'
>>> tf.__version__
'1.14.0'
pip install imageai
Requirement already satisfied: imageai in d:\python\lib\site-packages (2.1.5)

@yuanmu97
Copy link
Author

what is your python version?
Mine is python 3.6

@ucasiggcas
Copy link

Python 3.6.8rc1 (v3.6.8rc1:cc3e73212a, Dec 12 2018, 00:15:46) [MSC v.1900 64 bit (AMD64)] on win32

@yuanmu97
Copy link
Author

My roommate just tested the environment on Python 3.5.5 with
tf=1.14
keras=2.3.1
imageai=2.1.5
Maybe you can have a try.

He worked on Ubuntu 16.04 with Intel CPUs and 1080 GPU.

@ucasiggcas
Copy link

ucasiggcas commented Nov 25, 2019

py 3.5.2 tf-gpu=1.12 keras=2.24 也是不行
imageai训练的load_model都不能加载。。。。

@yuanmu97
Copy link
Author

这个有点奇怪,我和室友都正常可以用的
你自己多搞几个虚拟环境试试吧😂

@ucasiggcas
Copy link

ucasiggcas commented Nov 25, 2019

大佬,为啥我重新用imageai训练,采用作者的脚本,训练200次,最多才62%啊?
他的74%咋来的啊?有点坑啊
大佬能否提供个好点的模型啊?多谢

@ucasiggcas
Copy link

image
随机选择了205个测试集中照片,acc只有68%。。。。

@Snickbrack
Copy link

Could you please use the general language here? Maybe I have the same issue and now can't correctly read your comments...

@ucasiggcas
Copy link

Chinese is the common language,哈哈,大家都在说中文,中文好听。

@Snickbrack
Copy link

Snickbrack commented Nov 27, 2019

as you can see in all of the issues here english is the most common and most used language. Please use english here in the issue section as other like me cannot read the comments in chinese...

Edit: Google Translator: "哈哈,大家都在说中文,中文好听。" => "Haha, everyone is speaking Chinese, and it sounds good."

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

3 participants