keras2cpp icon indicating copy to clipboard operation
keras2cpp copied to clipboard

Compatible for python3 and new keras

Open GeorgeKAHChen opened this issue 7 years ago • 3 comments

GeorgeKAHChen avatar Sep 30 '18 09:09 GeorgeKAHChen

For some reason we found this program to change python, keras to cpp. However after we used, we found some problem for this program. On the one hand, there are some little problem on python2 to python3. On the other hand, some subject of the json file of new keras has been changed. And after test, finally, we build a new version on this site

https://github.com/KazukiAmakawa/keras2cpp

GeorgeKAHChen avatar Sep 30 '18 10:09 GeorgeKAHChen

@KazukiAmakawa Hi, I tried your package, and got one warning and one error: /data/fitpu/py_vt/tutorial-env/lib/python3.5/site-packages/keras/engine/base_layer.py:1109: UserWarning: Update your Dense call to the Keras 2 API: Dense(kernel_regularizer=None, trainable=True, units=10, kernel_initializer="glorot_uniform", activation="linear", activity_regularizer=None, bias_regularizer=None, bias_constraint=None, use_bias=True, input_dim=None, kernel_constraint=None, name="dense_2") return cls(**config) Traceback (most recent call last): File "dump_to_simple_cpp.py", line 48, in fout.write(str(W.shape[0]) + ' ' + str(W.shape[1]) + ' ' + str(W.shape[2]) + ' ' + str(W.shape[3]) + ' ' + l['config']['padding'] + '\n') KeyError: 'padding'

djsg avatar Dec 27 '18 04:12 djsg

@KazukiAmakawa Hi, I tried your package, and got one warning and one error: /data/fitpu/py_vt/tutorial-env/lib/python3.5/site-packages/keras/engine/base_layer.py:1109: UserWarning: Update your Dense call to the Keras 2 API: Dense(kernel_regularizer=None, trainable=True, units=10, kernel_initializer="glorot_uniform", activation="linear", activity_regularizer=None, bias_regularizer=None, bias_constraint=None, use_bias=True, input_dim=None, kernel_constraint=None, name="dense_2") return cls(**config) Traceback (most recent call last): File "dump_to_simple_cpp.py", line 48, in fout.write(str(W.shape[0]) + ' ' + str(W.shape[1]) + ' ' + str(W.shape[2]) + ' ' + str(W.shape[3]) + ' ' + l['config']['padding'] + '\n') KeyError: 'padding'

This implementation does not work with python3. See issue #41

gosha20777 avatar Jan 17 '19 12:01 gosha20777