解压缩
! unzip /content/contextual-multimodal-fusion-master.zip
转目录
%cd /content/contextual-multimodal-fusion-master
运行
!python create_data.py
!python trimodal_attention_models.py
错误
1.9,10,11行改为
config = tf.compat.v1.ConfigProto() config.gpu_options.allow_growth=True sess=tf.compat.v1.Session(config=config)
2.268行改为
tf.random.set_seed(j)
最后出现错误找不到文件
Traceback (most recent call last): File "/content/contextual-multimodal-fusion-master/trimodal_attention_models.py", line 319, in <module> train(mode) File "/content/contextual-multimodal-fusion-master/trimodal_attention_models.py", line 294, 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)
哦哦它需要运行creat.py那个
实验文件是两个