LSTM-FCN icon indicating copy to clipboard operation
LSTM-FCN copied to clipboard

TypeError: ('Keyword argument not understood:', 'use_chrono_initialization')

Open Huii opened this issue 6 years ago • 4 comments
trafficstars

First of all: Thanks a lot for providing this code!

Unfortuantely, I get an error whenever I try to test the trained models, which were written to the disk. You can find the traceback below:

Traceback (most recent call last):
  File "pathToProject\Main.py", line 87, in <module>
    ANNs.evaluateSavedModels(ALSTM_FCNOutputFolderAllData,modelTypeString,annotatedDataDictionaryWithoutNoiseAndWithoutExcludedDataTruncated,resultsFolderAllData,scalerID,truncationIndizes,annotationIndizes)
  File "pathToProject\ANNs.py", line 260, in evaluateSavedModels
    [predictions,currentModelSummary] = loadAndEvaluateGivenModel(completePathToModelFile,testXScaled)
  File "pathToProject\ANNs.py", line 75, in loadAndEvaluateGivenModel
    model = load_model(pathToModel,custom_objects={'AttentionLSTM': AttentionLSTM})
  File "pathToAnaconda\Anaconda\lib\site-packages\keras\engine\saving.py", line 492, in load_wrapper
    return load_function(*args, **kwargs)
  File "pathToAnaconda\Anaconda\lib\site-packages\keras\engine\saving.py", line 584, in load_model
    model = _deserialize_model(h5dict, custom_objects, compile)
  File "pathToAnaconda\Anaconda\lib\site-packages\keras\engine\saving.py", line 274, in _deserialize_model
    model = model_from_config(model_config, custom_objects=custom_objects)
  File "pathToAnaconda\Anaconda\lib\site-packages\keras\engine\saving.py", line 627, in model_from_config
    return deserialize(config, custom_objects=custom_objects)
  File "pathToAnaconda\Anaconda\lib\site-packages\keras\layers\__init__.py", line 168, in deserialize
    printable_module_name='layer')
  File "pathToAnaconda\Anaconda\lib\site-packages\keras\utils\generic_utils.py", line 147, in deserialize_keras_object
    list(custom_objects.items())))
  File "pathToAnaconda\Anaconda\lib\site-packages\keras\engine\network.py", line 1056, in from_config
    process_layer(layer_data)
  File "pathToAnaconda\Anaconda\lib\site-packages\keras\engine\network.py", line 1042, in process_layer
    custom_objects=custom_objects)
  File "pathToAnaconda\Anaconda\lib\site-packages\keras\layers\__init__.py", line 168, in deserialize
    printable_module_name='layer')
  File "pathToAnaconda\Anaconda\lib\site-packages\keras\utils\generic_utils.py", line 149, in deserialize_keras_object
    return cls.from_config(config['config'])
  File "pathToLSTMCode/LSTM-FCN/utils\layer_utils.py", line 730, in from_config
    return cls(**config)
  File "pathToAnaconda\Anaconda\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "pathToLSTMCode/LSTM-FCN/utils\layer_utils.py", line 596, in __init__
    **kwargs)
  File "pathToAnaconda\Anaconda\lib\site-packages\keras\layers\recurrent.py", line 410, in __init__
    super(RNN, self).__init__(**kwargs)
  File "pathToAnaconda\Anaconda\lib\site-packages\keras\engine\base_layer.py", line 147, in __init__
    raise TypeError('Keyword argument not understood:', kwarg)
TypeError: ('Keyword argument not understood:', 'use_chrono_initialization')

I'm using keras (Version: 2.3.1) and TensorFlow (Version: 2.0.0).

Huii avatar Oct 22 '19 14:10 Huii

Our codebase does not support this use_chrono_initialization value. May I ask where you found this flag ?

titu1994 avatar Oct 22 '19 15:10 titu1994

In your code it can be found in the file "layer_utils.py" for example.

Huii avatar Oct 23 '19 11:10 Huii

It's an unused flag, it can be removed from the get_config section.

titu1994 avatar Oct 23 '19 12:10 titu1994

Oh, ok. I, see. Thank you very much. In that case you can close this issue. I'll let you know if I run into another problem. :)

Huii avatar Oct 23 '19 16:10 Huii