mabaorui / OnSurfacePrior

Implementation of CVPR'2022:Reconstructing Surfaces for Sparse Point Clouds with On-Surface Priors
MIT License
196 stars 27 forks source link

Passed save_path is not a valid checkpoint #5

Closed joerowelll closed 2 years ago

joerowelll commented 2 years ago

I am trying to run the pretrained model on a .ply file with the --test command, and I am getting the error:

ValueError: The passed save_path is not a valid checkpoint: /home/user/COMP0132/workspace/surfaceReconmodel-0

when running

python onSurPrior.py --data_dir ~/COMP0132/Mesh/data --out_dir ~/COMP0132/workspace/surfaceRecon --CUDA 0 --INPUT_NUM   189470 --epoch 30000 --input_ply_file  ~/COMP0132/brighton_text/Mesh/data/brighton.ply --test

--data_dir is the directory with input.ply (brighton.ply)
--out_dir is the empty directory you want output in
--input_ply_file brighton.ply (with or without full path?)
Is this correct? I am a little confused as to the parsed arguments and which should be which.

System Ubuntu 18.04 No GPU

NiluK commented 1 year ago

Did you manage to get this resolved? It is indeed confusing

Bailey-24 commented 1 year ago

Do you understand the parse?

NiluK commented 1 year ago

Basically what's the point of the data_dir and the input_ply_file? everything else is good but those two arguments seem to be the same?

Bailey-24 commented 1 year ago

In onSurPrior.py#L777
point_sparse = np.load(a.data_dir + a.input_ply_file + '.npz')['pointcloud_s']

This need npz file, but I don't know how to convert the ply file to npz.

How do you solve the problem? Could you please share the ply and npz file?

NiluK commented 1 year ago

Ah yep, that solved it, thanks!

Bailey-24 commented 1 year ago

That's awesome.

But how to solve my problem? Do you have npz and ply file?

NiluK commented 1 year ago

I have this ply file, https://qndkppmmrjbidgjntwgt.supabase.co/storage/v1/object/public/3d-models/items/test/55c820a2-e5d3-455a-b678-8e76e2.ply?t=2023-02-02T08%3A20%3A54.699Z (sparse point cloud, 4k generated by point-e)

I don't have an npz atm but you can use https://pypi.org/project/pyntcloud/ to convert that into an NPZ.

mabaorui commented 1 year ago

.npz does not need to be prepared by the user, it will be automatically generated in '--data_dir' folder after the program is executed

Bailey-24 commented 1 year ago

but why my program doesn't automatically generate the npz file. I run the following command.(I didn't train the model, I use your pretrain model, so I change OnSurfacePrior.py#775 to saver.restore(sess, a.out_dir + 'model-10201') , and the following --out_dir ./pre_train_model)

python onSurPrior.py --data_dir ./data/ --out_dir ./pre_train_model/ --CUDA 0 --INPUT_NUM 500 --epoch 30000 --input_ply_file input.ply --test

But I got error

Traceback (most recent call last):
  File "onSurPrior.py", line 779, in <module>
    point_sparse = np.load(a.data_dir + a.input_ply_file + '.npz')['pointcloud_s']
  File "/home/pi/anaconda3/envs/tf/lib/python3.6/site-packages/numpy/lib/npyio.py", line 416, in load
    fid = stack.enter_context(open(os_fspath(file), "rb"))
FileNotFoundError: [Errno 2] No such file or directory: './data/input.ply.npz'

The data folder only have input.ply file.

mabaorui commented 1 year ago

I modified some of the code to make it automatically generate .npz file, please update it.