pointnet生成h5文件报错ValueError: Unable to create dataset

报错

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)

网上找了很多原因,都没解决,自己看看其实很简单。

h5py安装没问题。所有要么路径问题,要么程序问题:

路径应该没问题,看程序

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)权限,

  • 7
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值