Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On the training duration of the model #9

Open
huyanbi opened this issue Mar 24, 2023 · 14 comments
Open

On the training duration of the model #9

huyanbi opened this issue Mar 24, 2023 · 14 comments

Comments

@huyanbi
Copy link

huyanbi commented Mar 24, 2023

I would like to ask how many Nepochs need to be trained using the 48g dataset of PCN, and how long it will take to train.

@XLechter
Copy link
Owner

Hi @huyanbi , I apologize for not mentioning the epochs in the paper. I remember I use about 80-100 epochs, which will take about 4-5 days on a single 2080Ti due to the computation of the attention modules.

@XLechter
Copy link
Owner

Maybe you can also check a recent work SeedFormer ECCV 2022. This work is both effective and efficient.

@huyanbi
Copy link
Author

huyanbi commented Mar 25, 2023

sorry,I found that after the test, it seemed like there was only a CD_ p,CD_ t and F1 results do not appear to have visual point cloud results. Due to previous training errors , I commented on the model's global count dirpath = '/mnt/data1/zwx/ICCV_SUB/results_sub' plot_coarse_fine(x.transpose(1, 2).contiguous().cpu().detach().numpy()[0], fine.cpu().detach().numpy()[0]) plt.savefig(dirpath + '/' + str(count) + '.png') count = count+1
What do I need to do to see visual test results?

@XLechter
Copy link
Owner

sorry,I found that after the test, it seemed like there was only a CD_ p,CD_ t and F1 results do not appear to have visual point cloud results. Due to previous training errors , I commented on the model's global count dirpath = '/mnt/data1/zwx/ICCV_SUB/results_sub' plot_coarse_fine(x.transpose(1, 2).contiguous().cpu().detach().numpy()[0], fine.cpu().detach().numpy()[0]) plt.savefig(dirpath + '/' + str(count) + '.png') count = count+1 What do I need to do to see visual test results?

@huyanbi There are several ways for visualization. In the paper, I convert the results to ply files and visualize them using keyshot. You can refer to https://github.com/kangxue/How-do-I-render-point-clouds

Otherwise, you can refer to https://github.com/XLechter/Utils/blob/main/vis_pcd.py, which I used to visualize a set of point clouds quickly.

@huyanbi
Copy link
Author

huyanbi commented Mar 25, 2023

I don't know if I didn't see it. I didn't find the results generated after the test and the ply files you mentioned. The following is the result of my test. I will generate a file after removing the comments
image

@XLechter
Copy link
Owner

I don't know if I didn't see it. I didn't find the results generated after the test and the ply files you mentioned. The following is the result of my test. I will generate a file after removing the comments image

A simple way to visualize is that you can first transfer the output to numpy array

SDT/test.py

Line 86 in 432f6ef

coarse, output = net(inputs)

and using the following codes to save them as ply files:
import open3d as o3d
pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(output)
o3d.io.write_point_cloud('output.ply', pcd)

@huyanbi
Copy link
Author

huyanbi commented Mar 26, 2023

@XLechter , Excuse me, do you want to save the output in the. h5 file. I found that your test code comments include saving the input point cloud, output point cloud, and rough output of each batch as an. h5 file. In each batch iteration, write the corresponding point cloud data into the file's code. Is it usable? Should I create an. h file before using it? for example g_input_pcd = h5py.File(os.path.join(args.model_dir, '%s_input_pcds.h5' % epoch.split('.')[0]), 'w') g_gt_pcd = h5py.File(os.path.join(args.model_dir, '%s_gt_pcds.h5' % epoch.split('.')[0]), 'w') g_output_pcd = h5py.File(os.path.join(args.model_dir, '%s_output_pcds.h5' % epoch.split('.')[0]), 'w') g_coarse_pcd = h5py.File(os.path.join(args.model_dir, '%s_coarse_pcds.h5' % epoch.split('.')[0]), 'w')
I canceled the comment below your save pcd.
image
Are these. h5 files converted to ply files what you call output.ply.Thank you very much for your answer.

@XLechter
Copy link
Owner

@XLechter , Excuse me, do you want to save the output in the. h5 file. I found that your test code comments include saving the input point cloud, output point cloud, and rough output of each batch as an. h5 file. In each batch iteration, write the corresponding point cloud data into the file's code. Is it usable? Should I create an. h file before using it? for example g_input_pcd = h5py.File(os.path.join(args.model_dir, '%s_input_pcds.h5' % epoch.split('.')[0]), 'w') g_gt_pcd = h5py.File(os.path.join(args.model_dir, '%s_gt_pcds.h5' % epoch.split('.')[0]), 'w') g_output_pcd = h5py.File(os.path.join(args.model_dir, '%s_output_pcds.h5' % epoch.split('.')[0]), 'w') g_coarse_pcd = h5py.File(os.path.join(args.model_dir, '%s_coarse_pcds.h5' % epoch.split('.')[0]), 'w') I canceled the comment below your save pcd. image Are these. h5 files converted to ply files what you call output.ply.Thank you very much for your answer.

Actually, these codes are written for saving different testing results for ablation studies. It is better for you to directly save ply files for visualization as I mentioned before.

@huyanbi
Copy link
Author

huyanbi commented Mar 26, 2023

But using the method you mentioned above will report an error.
image

@huyanbi
Copy link
Author

huyanbi commented Mar 26, 2023

Do you want to perform the reshape process? I tried and didn't solve it.

@XLechter
Copy link
Owner

Do you want to perform the reshape process? I tried and didn't solve it.

First, convert the output from tensor to numpy array on CPU. Second, make sure each output to have shape (N, 3) with a for loop.
Cause I cannot access to the original env I used for this project, or I can write and test this for you.

@huyanbi
Copy link
Author

huyanbi commented Mar 27, 2023

@XLechter ,Sorry, I failed. But I found that it seems that the generated output data is placed in the model_ pcds.h5. Could you tell me how to read it out. And how to test the results of cd and f1 for each category.

@XLechter
Copy link
Owner

@XLechter ,Sorry, I failed. But I found that it seems that the generated output data is placed in the model_ pcds.h5. Could you tell me how to read it out. And how to test the results of cd and f1 for each category.

@huyanbi Sorry for the late reply, as I am on leave. I think you would better save the output array with your own codes for convenience. You can check how to save and read numpy array with h5py. Simply, it follows a format like: file['key'] = array. It is commonly used for saving data.

@superluming-luming355
Copy link

问一下 ,训练出来的模型 哪一个测试能得到文字的结果?谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants