Skip to content

utils.visualization.multiple_plot_voxel raise ValueError #7

@JayFu

Description

@JayFu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions