Part3_daily_forecast_colab卡住
2022/06/26 上午 11:51
《用 Python 打造你的 AI 股票交易引擎》業界專家實戰教學
林志翔
觀看數:3
回答數:0
收藏數:0
執行到
data_1d = cs.load_char('1d_char.csv')
data_2d = cs.load_char('2d_char.csv', MAX_CHAR_LENGTH)
model_1d1 = cs.load_model(data_1d, model_file='1d_1D_bak')
model_2d1 = cs.load_model(data_2d, model_file='2d_1D_bak')
model_1 = cs.blending_model([model_1d1, model_2d1], [0.7])
model_1d60 = cs.load_model(data_1d, model_file='1d_60D_bak')
model_2d60 = cs.load_model(data_2d, model_file='2d_60D_bak')
model_60 = cs.blending_model([model_1d60, model_2d60], [0.7])
cs.predict_result(trading_params=TRADING_PARAMS, model_d1=model_1, model_d60=model_60)
===========================輸出========================================
WARNING:tensorflow:The following Variables were used in a Lambda layer's call (tf.keras.backend.rnn_2), but are not present in its tracked objects:
. This is a strong indication that the Lambda layer should be rewritten as a subclassed Layer.
WARNING:tensorflow:The following Variables were used in a Lambda layer's call (tf.keras.backend.rnn_3), but are not present in its tracked objects:
. This is a strong indication that the Lambda layer should be rewritten as a subclassed Layer.
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in ()
2 data_2d = cs.load_char('2d_char.csv', MAX_CHAR_LENGTH)
3 model_1d1 = cs.load_model(data_1d, model_file='1d_1D_bak')
----> 4 model_2d1 = cs.load_model(data_2d, model_file='2d_1D_bak')
5 model_1 = cs.blending_model([model_1d1, model_2d1], [0.7])
6 model_1d60 = cs.load_model(data_1d, model_file='1d_60D_bak')
2 frames
/usr/local/lib/python3.7/dist-packages/keras/saving/hdf5_format.py in load_weights_from_hdf5_group(f, model)
727 if len(layer_names) != len(filtered_layers):
728 raise ValueError(
--> 729 f'Layer count mismatch when loading weights from file. '
730 f'Model expected {len(filtered_layers)} layers, found '
731 f'{len(layer_names)} saved layers.')
ValueError: Layer count mismatch when loading weights from file. Model expected 1 layers, found 3 saved layers.