# Load COCO data from disk into a dictionary.
# We'll work with dimensionality-reduced features for the remainder of this assignment,
# but you can also experiment with the original features on your own by changing the flag below.
data = load_coco_data(pca_features=True)
# Print out all the keys and values from the data dictionary.
for k, v in data.items():
if type(v) == np.ndarray:
print(k, type(v), v.shape, v.dtype)
else:
print(k, type(v), len(v))
base dir D:\cs231n.github.io-master\assignments\2021\assignment3_colab\assignment3\cs231n\datasets/coco_captioning
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
Cell In[6], line 4
1 # Load COCO data from disk into a dictionary.
2 # We'll work with dimensionality-reduced features for the remainder of this assignment,
3 # but you can also experiment with the original features on your own by changing the flag below.
----> 4 data = load_coco_data(pca_features=True)
6 # Print out all the keys and values from the data dictionary.
7 for k, v in data.items():
File D:\cs231n.github.io-master\assignments\2021\assignment3_colab\assignment3\cs231n\coco_utils.py:20, in load_coco_data(base_dir, max_train, pca_features)
18 else:
19 train_feat_file = os.path.join(base_dir, "train2014_vgg16_fc7.h5")
---> 20 with h5py.File(train_feat_file, "r") as f:
21 data["train_features"] = np.asarray(f["features"])
23 if pca_features:
File D:\miniconda\lib\site-packages\h5py\_hl\files.py:564, in File.__init__(self, name, mode, driver, libver, userblock_size, swmr, rdcc_nslots, rdcc_nbytes, rdcc_w0, track_order, fs_strategy, fs_persist, fs_threshold, fs_page_size, page_buf_size, min_meta_keep, min_raw_keep, locking, alignment_threshold, alignment_interval, meta_block_size, **kwds)
555 fapl = make_fapl(driver, libver, rdcc_nslots, rdcc_nbytes, rdcc_w0,
556 locking, page_buf_size, min_meta_keep, min_raw_keep,
557 alignment_threshold=alignment_threshold,
558 alignment_interval=alignment_interval,
559 meta_block_size=meta_block_size,
560 **kwds)
561 fcpl = make_fcpl(track_order=track_order, fs_strategy=fs_strategy,
562 fs_persist=fs_persist, fs_threshold=fs_threshold,
563 fs_page_size=fs_page_size)
--> 564 fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
566 if isinstance(libver, tuple):
567 self._libver = libver
File D:\miniconda\lib\site-packages\h5py\_hl\files.py:238, in make_fid(name, mode, userblock_size, fapl, fcpl, swmr)
236 if swmr and swmr_support:
237 flags |= h5f.ACC_SWMR_READ
--> 238 fid = h5f.open(name, flags, fapl=fapl)
239 elif mode == 'r+':
240 fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl)
File h5py/_objects.pyx:56, in h5py._objects.with_phil.wrapper()
File h5py/_objects.pyx:57, in h5py._objects.with_phil.wrapper()
File h5py/h5f.pyx:102, in h5py.h5f.open()
FileNotFoundError: [Errno 2] Unable to synchronously open file (unable to open file: name = 'D:\cs231n.github.io-master\assignments\2021\assignment3_colab\assignment3\cs231n\datasets/coco_captioning\train2014_vgg16_fc7_pca.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)
最新发布