tensorflow2加载别人的代码过程中遇到无法打开文件的问题

Traceback (most recent call last):
File "A:/下载/unet-tf2-main/train_medical.py", line 102, in
model.load_weights(model_path, by_name=True, skip_mismatch=True)
File "C:\Users\hp\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\keras\engine\training.py", line 250, in load_weights
return super(Model, self).load_weights(filepath, by_name, skip_mismatch)
File "C:\Users\hp\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\keras\engine\network.py", line 1259, in load_weights
with h5py.File(filepath, 'r') as f:
File "C:\Users\hp\Anaconda3\envs\tensorflow\lib\site-packages\h5py_hl\files.py", line 408, in init
swmr=swmr)
File "C:\Users\hp\Anaconda3\envs\tensorflow\lib\site-packages\h5py_hl\files.py", line 173, 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 88, in h5py.h5f.open
OSError: Unable to open file (unable to open file: name = './model_data/vgg16_weights_tf_dim_ordering_tf_kernels_notop.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)

我尝试了将代码提供者的相关.h5文件放入报错的几个路径下,但不能解决问题

你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答


本次提问扣除的有问必答次数,将会以问答VIP体验卡(1次有问必答机会、商城购买实体图书享受95折优惠)的形式为您补发到账户。


因为有问必答VIP体验卡有效期仅有1天,您在需要使用的时候【私信】联系我,我会为您补发。