File "/content/contextual-multimodal-fusion-master/trimodal_attention_models.py", line 327, in <module> train(mode) File "/content/contextual-multimodal-fusion-master/trimodal_attention_models.py", line 302, in train model.load_weights(path) File "/usr/local/lib/python3.10/dist-packages/keras/utils/traceback_utils.py", line 70, in error_handler raise e.with_traceback(filtered_tb) from None File "/usr/local/lib/python3.10/dist-packages/h5py/_hl/files.py", line 567, in __init__ fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr) File "/usr/local/lib/python3.10/dist-packages/h5py/_hl/files.py", line 231, in make_fid fid = h5f.open(name, flags, fapl=fapl) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "h5py/h5f.pyx", line 106, in h5py.h5f.open FileNotFoundError: [Errno 2] Unable to open file (unable to open file: name = 'weights/Mosi_Trimodal_MMMU_BA_Run_0.hdf5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)
上次实验出现的无法找到
weights/Mosi_Trimodal_MMMU_BA_Run_0.hdf5
的错误解决方法
需要把286行中的TRUE改成FALSE意为需要最开始先建立一个.hdf5文件再更新
check = ModelCheckpoint(path, monitor='val_accuracy', save_best_only=False, mode='max', verbose=0) #保存最好的模型权重
先让它生成一个,再改为TRUE让它更新为最好的
今天实验最好结果为
Accuracy 0.8031914893617021
结果未保存