Visualization issue when running pretraining a model in the tutorial

When running a pretraining in the tutorial, the visualization part shows an error as follows. But when I switch “equal” to “auto” the graph shows two graphs totally different from what the tutorial showed which makes it unable to recognize a banana.

File “/home/caotw/tbp/tbp.monty/src/tbp/monty/frameworks/utils/plot_utils.py”, line 99, in plot_graph
ax.set_aspect(“equal”) # equal
File “/home/caotw/miniconda3/envs/tbp.monty/lib/python3.8/site-packages/mpl_toolkits/mplot3d/axes3d.py”, line 323, in set_aspect
raise NotImplementedError(
NotImplementedError: Axes3D currently only supports the aspect argument ‘auto’. You passed in ‘equal’.

Hi @caotw

Welcome to the forum!

Could you tell us a little bit more about the environment you’re running on?

  • What the command you ran was
  • What your OS / Python Version

Any helpful log output that you can paste in a code block

like this

Would be great!

I just ran pretraining_tutorial_analysis.py as noted in your tutorial, and the environment is just the same as [environment.yml], the os is ubuntu 24.04. I think it is more like an environmental issue, as the package(Axes3D) does not support the ‘equal’ argument for ax.set_aspect(“equal”) and also I ask for ChatGPT that no version of this package support ‘equal’ argument

Thanks for the info! Currently we don’t yet support linux - you can follow this issue for when this is implemented

Are you sure? Since the tutorial says it supports linux (AMD64) (Getting Started) and most of codes can run directly with linux except for visualization part.

Oh, I think my knowledge is out of date - @tslominski could you take a look?

Hi @caotw, sorry about the problem.

What version of matplotlib is installed?

(tbp.monty) me@honestmistake tbp.monty % conda list | grep matplotlib
matplotlib                3.7.3            py38h50d1736_0    conda-forge
matplotlib-base           3.7.3            py38hcd1b199_0    conda-forge
(tbp.monty) me@honestmistake tbp.monty % pip list | grep matplotlib
matplotlib          3.7.3

With the above, I see:

    def set_aspect(self, aspect, adjustable=None, anchor=None, share=False):
        """
        Set the aspect ratios.

        Parameters
        ----------
        aspect : {'auto', 'equal', 'equalxy', 'equalxz', 'equalyz'}
            Possible values:

            =========   ==================================================
            value       description
            =========   ==================================================
            'auto'      automatic; fill the position rectangle with data.
            'equal'     adapt all the axes to have equal aspect ratios.
            'equalxy'   adapt the x and y axes to have equal aspect ratios.
            'equalxz'   adapt the x and z axes to have equal aspect ratios.
            'equalyz'   adapt the y and z axes to have equal aspect ratios.
            =========   ==================================================
1 Like

Upgrading matplotlib helps. ChatGPT misled me!

1 Like