TransUNet icon indicating copy to clipboard operation
TransUNet copied to clipboard

Unable to open file (truncated file: eof = 6398976, sblock->base_addr = 0, stored_eof = 193988608)

Open wtkszzz opened this issue 3 years ago • 0 comments

当我运行test.py时,报出如下错误: `python test.py --dataset Synapse --vit_name R50-ViT-B_16 Namespace(Dataset=<class 'datasets.dataset_synapse.Synapse_dataset'>, base_lr=0.01, batch_size=24, dataset='Synapse', deterministic=1, exp='TU_Synapse224', img_size=224, is_pretrain=True, is_savenii=False, list_dir='./lists/lists_Synapse', max_epochs=150, max_iterations=20000, n_skip=3, num_classes=9, seed=1234, test_save_dir='../predictions', vit_name='R50-ViT-B_16', vit_patches_size=16, volume_path='../data/Synapse/test_vol_h5', z_spacing=1) TU_pretrain_R50-ViT-B_16_skip3_epo150_bs24_224 12 test iterations per epoch 0it [00:00, ?it/s] Traceback (most recent call last): File "/opt/conda/envs/liushidi/lib/python3.7/site-packages/h5py/_hl/files.py", line 162, in make_fid fid = h5f.open(name, h5f.ACC_RDWR, 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 78, in h5py.h5f.open OSError: Unable to open file (truncated file: eof = 6398976, sblock->base_addr = 0, stored_eof = 193988608)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/conda/envs/liushidi/lib/python3.7/site-packages/h5py/_hl/files.py", line 165, in make_fid fid = h5f.open(name, h5f.ACC_RDONLY, 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 78, in h5py.h5f.open OSError: Unable to open file (truncated file: eof = 6398976, sblock->base_addr = 0, stored_eof = 193988608)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "test.py", line 138, in inference(args, net, test_save_path) File "test.py", line 51, in inference for i_batch, sampled_batch in tqdm(enumerate(testloader)): File "/opt/conda/envs/liushidi/lib/python3.7/site-packages/tqdm/std.py", line 1180, in iter for obj in iterable: File "/opt/conda/envs/liushidi/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in next data = self._next_data() File "/opt/conda/envs/liushidi/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/opt/conda/envs/liushidi/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/opt/conda/envs/liushidi/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/opt/data/private/test14/liushidi/code/medical/project_TransUNet/TransUNet/datasets/dataset_synapse.py", line 68, in getitem data = h5py.File(filepath) File "/opt/conda/envs/liushidi/lib/python3.7/site-packages/h5py/_hl/files.py", line 312, in init fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr) File "/opt/conda/envs/liushidi/lib/python3.7/site-packages/h5py/_hl/files.py", line 167, in make_fid fid = h5f.create(name, h5f.ACC_EXCL, fapl=fapl, fcpl=fcpl) 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 98, in h5py.h5f.create OSError: Unable to create file (unable to open file: name = '../data/Synapse/test_vol_h5/case0008.npy.h5', errno = 17, error message = 'File exists', flags = 15, o_flags = c2) ` 有人遇到这个问题吗,求解决

wtkszzz avatar Mar 01 '22 11:03 wtkszzz