报错
Traceback (most recent call last):
File "/home/chengle/a_program/pointnet/sem_seg/gen_indoor3d_h5.py", line 89, in <module>
insert_batch(data, label, i == len(data_label_files)-1)
File "/home/chengle/a_program/pointnet/sem_seg/gen_indoor3d_h5.py", line 70, in insert_batch
data_prep_util.save_h5(h5_filename, h5_batch_data[0:buffer_size, ...], h5_batch_label[0:buffer_size, ...], data_dtype, label_dtype)
File "/home/chengle/a_program/pointnet/utils/data_prep_util.py", line 80, in save_h5
h5_fout = h5py.File(h5_filename)
File "/home/chengle/anaconda3/envs/pn/lib/python3.7/site-packages/h5py/_hl/files.py", line 445, in __init__
(32, 4096, 9), (32, 4096)
1
swmr=swmr)
File "/home/chengle/anaconda3/envs/pn/lib/python3.7/site-packages/h5py/_hl/files.py", line 195, 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 96, in h5py.h5f.open
FileNotFoundError: [Errno 2] Unable to open file (unable to open file: name = 'ply_data_all_0.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)
网上找了很多原因,都没解决,自己看看其实很简单。
路径应该没问题,看程序
File "/home/chengle/a_program/pointnet/utils/data_prep_util.py", line 84, in save_h5
dtype=data_dtype)
data_prep_util.py第84行
h5_fout = h5py.File(h5_filename)
使用手册写法
hf = h5py.File('data.h5', 'w')
所以写成
h5_fout = h5py.File(h5_filename, 'w')
应该是程序没有打开写入(w)权限,