I was exploring some of the models given in this repository. But I can't seem to convert the micro-models/keras folder's model. As given in the readme I am using TensorFlow >= 2.0.0.
I tried various approaches, trained a small model in colab, but there seem to be issues anyways.
When I am directly using mnist.yml from the folder I am facing this error.
File "tools/python/convert.py", line 282, in <module>
convert(conf, flags.output, flags.enable_micro)
File "tools/python/convert.py", line 89, in convert
net_def_with_Data = convert_net(net_name, net_conf, enable_micro)
File "tools/python/convert.py", line 226, in convert_net
option, conf["model_file_path"])
File "/home/hitech/aware/mace/tools/python/transform/keras_converter.py", line 205, in __init__
compile=False)
File "/home/hitech/anaconda3/envs/mace/lib/python3.6/site-packages/tensorflow/python/keras/saving/save.py", line 184, in load_model
return hdf5_format.load_model_from_hdf5(filepath, custom_objects, compile)
File "/home/hitech/anaconda3/envs/mace/lib/python3.6/site-packages/tensorflow/python/keras/saving/hdf5_format.py", line 178, in load_model_from_hdf5
custom_objects=custom_objects)
File "/home/hitech/anaconda3/envs/mace/lib/python3.6/site-packages/tensorflow/python/keras/saving/model_config.py", line 55, in model_from_config
return deserialize(config, custom_objects=custom_objects)
File "/home/hitech/anaconda3/envs/mace/lib/python3.6/site-packages/tensorflow/python/keras/layers/serialization.py", line 109, in deserialize
printable_module_name='layer')
File "/home/hitech/anaconda3/envs/mace/lib/python3.6/site-packages/tensorflow/python/keras/utils/generic_utils.py", line 373, in deserialize_keras_object
list(custom_objects.items())))
File "/home/hitech/anaconda3/envs/mace/lib/python3.6/site-packages/tensorflow/python/keras/engine/sequential.py", line 398, in from_config
custom_objects=custom_objects)
File "/home/hitech/anaconda3/envs/mace/lib/python3.6/site-packages/tensorflow/python/keras/layers/serialization.py", line 109, in deserialize
printable_module_name='layer')
File "/home/hitech/anaconda3/envs/mace/lib/python3.6/site-packages/tensorflow/python/keras/utils/generic_utils.py", line 375, in deserialize_keras_object
return cls.from_config(cls_config)
File "/home/hitech/anaconda3/envs/mace/lib/python3.6/site-packages/tensorflow_model_optimization/python/core/quantization/keras/quantize_wrapper.py", line 206, in from_config
layer = tf.keras.layers.deserialize(config.pop('layer'))
File "/home/hitech/anaconda3/envs/mace/lib/python3.6/site-packages/tensorflow/python/keras/layers/serialization.py", line 109, in deserialize
printable_module_name='layer')
File "/home/hitech/anaconda3/envs/mace/lib/python3.6/site-packages/tensorflow/python/keras/utils/generic_utils.py", line 375, in deserialize_keras_object
return cls.from_config(cls_config)
File "/home/hitech/anaconda3/envs/mace/lib/python3.6/site-packages/tensorflow/python/keras/engine/base_layer.py", line 655, in from_config
return cls(**config)
File "/home/hitech/anaconda3/envs/mace/lib/python3.6/site-packages/tensorflow/python/keras/layers/convolutional.py", line 599, in __init__
**kwargs)
File "/home/hitech/anaconda3/envs/mace/lib/python3.6/site-packages/tensorflow/python/keras/layers/convolutional.py", line 125, in __init__
**kwargs)
File "/home/hitech/anaconda3/envs/mace/lib/python3.6/site-packages/tensorflow/python/training/tracking/base.py", line 456, in _method_wrapper
result = method(self, *args, **kwargs)
File "/home/hitech/anaconda3/envs/mace/lib/python3.6/site-packages/tensorflow/python/keras/engine/base_layer.py", line 294, in __init__
generic_utils.validate_kwargs(kwargs, allowed_kwargs)
File "/home/hitech/anaconda3/envs/mace/lib/python3.6/site-packages/tensorflow/python/keras/utils/generic_utils.py", line 792, in validate_kwargs
raise TypeError(error_message, kwarg)
TypeError: ('Keyword argument not understood:', 'groups')
When I am using the model from the above link I am getting the following error :-
File "tools/python/convert.py", line 282, in <module>
convert(conf, flags.output, flags.enable_micro)
File "tools/python/convert.py", line 89, in convert
net_def_with_Data = convert_net(net_name, net_conf, enable_micro)
File "tools/python/convert.py", line 238, in convert_net
output_graph_def, quantize_activation_info = mace_transformer.run()
File "/home/hitech/aware/mace/tools/python/transform/transformer.py", line 166, in run
changed = transformer()
File "/home/hitech/aware/mace/tools/python/transform/transformer.py", line 1623, in sort_by_execution
"output_tensor %s not existed in model" % output_node)
File "/home/hitech/aware/mace/tools/python/utils/util.py", line 76, in mace_check
for line in traceback.format_stack():
ERROR: /home/hitech/aware/mace/tools/python/transform/transformer.py:1623: output_tensor output not existed in model
I verified my model using netron, and everything seems fine.
my yml file
Can anyone confirm if keras models are working properly in their systems ?? If yes, please share your environments. And please let me know what I am doing wrong.
Keras Models seems to be working with Tensorflow 2.3.0, but in documentation, it is written as TF >=2. I tried with all other versions which were throwing some errors.
I was exploring some of the models given in this repository. But I can't seem to convert the
micro-models/keras
folder's model. As given in the readme I am using TensorFlow >= 2.0.0. I tried various approaches, trained a small model in colab, but there seem to be issues anyways.When I am directly using
mnist.yml
from the folder I am facing this error.The colab link has the same code as the code given in the
micro-models/keras
folder :- https://colab.research.google.com/drive/1_GhO4805M_aSk1kIOVDFlVA-b1nGusBi?usp=sharingWhen I am using the model from the above link I am getting the following error :-
I verified my model using netron, and everything seems fine. my yml file
Can anyone confirm if keras models are working properly in their systems ?? If yes, please share your environments. And please let me know what I am doing wrong.
Any suggestions are appreciated.