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

utils.visualization.multiple_plot_voxel raise ValueError #7

Open
JayFu opened this issue Jun 29, 2022 · 1 comment
Open

utils.visualization.multiple_plot_voxel raise ValueError #7

JayFu opened this issue Jun 29, 2022 · 1 comment

Comments

@JayFu
Copy link

JayFu commented Jun 29, 2022

Hi, thanks for the brilliant works.

I met errors while both training steps. such as

Traceback (most recent call last):
  File "train_post_clip.py", line 366, in <module>
    main()          
  File "train_post_clip.py", line 350, in main
    generate_on_query_text(args, clip_model, net, latent_flow_network)
  File "train_post_clip.py", line 182, in generate_on_query_text
    visualization.multiple_plot_voxel(voxels_out, save_loc=save_loc +"{}_text_query.png".format(text_in))
  File "/root/Clip-Forge/utils/visualization.py", line 212, in multiple_plot_voxel
    ax = fig.add_subplot(plt_num, projection=Axes3D.name)
  File "/opt/conda/lib/python3.7/site-packages/matplotlib/figure.py", line 772, in add_subplot
    ax = subplot_class_factory(projection_class)(self, *args, **pkw)
  File "/opt/conda/lib/python3.7/site-packages/matplotlib/axes/_subplots.py", line 36, in __init__
    self.set_subplotspec(SubplotSpec._from_subplot_args(fig, args))
  File "/opt/conda/lib/python3.7/site-packages/matplotlib/gridspec.py", line 583, in _from_subplot_args
    f"Single argument to subplot must be a three-digit "
ValueError: Single argument to subplot must be a three-digit integer, not '131'

This occurs after first epoch (for autoencoder).

I located the vis functions line, noted it by sharp symbol and the training worked well.

Since I reviewed the code, I found the code in utils.visualization.multiple_plot_voxel (line 213 in file ./utils/visualization.py)
passed a str type value to fig.add_subplot function:

        plt_num = "1" + str(len(batch_data_points)) +str(i+1)
        ax = fig.add_subplot(plt_num, projection=Axes3D.name)

Based on Api Doc of Matplotlib , an int value shall be passed into this function instead of a str value.

Please check if this function works well or error orrcured due to lib version.

@sanghiad
Copy link
Collaborator

sanghiad commented Jul 8, 2022

@JayFu I believe this is due to lib version. What lib version are you using?

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

2 participants