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

Debug #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Debug #11

wants to merge 3 commits into from

Conversation

KyleRoss-rice
Copy link

Fix for "off-by-one" issue in the main loop

for i in range(opts.iterations):
    //...

    if i % 1 == 0:
        print(f'{os.path.basename(opts.input_pc)}; iter: {i} out of: {opts.iterations}; loss: {loss.item():.4f};'
                f' sample count: {num_samples}; time: {end_time - start_time:.2f}')
    if i % opts.export_interval == 0 and i > 0:
        print('exporting reconstruction... current LR: {}'.format(optimizer.param_groups[0]['lr']))
        with torch.no_grad():
            part_mesh.export(os.path.join(opts.save_path, f'recon_iter_{i}.obj'))

    //...

if opts.iterations == 100, for example, then the range for i is [0, 99].
On the final iteration, iter: 99 out of: 100 is printed.

if opts.export_interval == 100, then i % opts.export_interval == 0 is always false, since i never reaches a multiple of 100. No reconstructed mesh is exported.

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

Successfully merging this pull request may close these issues.

None yet

1 participant