我想用keras(版本2.1.3)构建一个深度学习网络,逐帧分析视频流。我试图使用TimeDistributed层并得到我的网络:
video = keras.Input(shape=(32,150,150,3), name='video')
cnn = InceptionV3(weights = 'imagenet', include_top=False,pooling='avg')
cnn.trainable = False
frame_features = layers.TimeDistributed(cnn)(video)
video_vector = layers.LSTM(256)(frame_features)
predictions = Dense(101, activation='softmax')(video_vector)
model = Model(inputs=video, outputs=predictions)
当我构建网络时出现错误:
ValueError: Variable batch_normalization_1/moving_mean/biased already exists, disallowed. Did you mean to set reuse=True in VarScope? Originally defined at:
File "D:\install\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1269, in __init__
self._traceback = _extract_stack()
File "D:\install\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 2506, in create_op
original_op=self._default_original_op, op_def=op_def)
File "D:\install\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 767, in apply_op
op_def=op_def)
谁能告诉我如何解决这个问题?谢谢!