Optuna: Visualization not working

Created on 22 Jan 2019  路  4Comments  路  Source: optuna/optuna

Hello.
I faced on error when:

import optuna

study = optuna.create_study()
...
optuna.visualization.plot_intermediate_values(study)

this shows:

AttributeError                            Traceback (most recent call last)
<ipython-input-11-04cb7fde5fca> in <module>
----> 1 optuna.visualization.plot_intermediate_values(study)

AttributeError: module 'optuna' has no attribute 'visualization'

Do I have to do something for visualization?

Most helpful comment

hello锛宨 have faced a similar problem, look like this:

D:Anacondapython.exe E:/pytorch_scratch/optuna_example.py
Traceback (most recent call last):
File "E:/pytorch_scratch/optuna_example.py", line 16, in
study = optuna.create_study()
AttributeError: module 'optuna' has no attribute 'create_study'

an interesting phenomenon is that when I run this code in Jupyter, it works well, but this error occurred when I run this demo in Pycharm

I have finished this problem, please check the name of the file. The reason i met the problem is that there is a file named optuna.py.

All 4 comments

Hi. Thanks for reporting the issue.

Have you installed Optuna from master branch?

The visualization module has not been released yet in PyPi, but just in master branch. Thus, current pip installation may cause the error: AttributeError: module 'optuna' has no attribute 'visualization'.

@g-votte okay thanks! I'm testing with pip pkg manager, so it was the reason.

hello锛宨 have faced a similar problem, look like this:

D:Anacondapython.exe E:/pytorch_scratch/optuna_example.py
Traceback (most recent call last):
File "E:/pytorch_scratch/optuna_example.py", line 16, in
study = optuna.create_study()
AttributeError: module 'optuna' has no attribute 'create_study'

an interesting phenomenon is that when I run this code in Jupyter, it works well, but this error occurred when I run this demo in Pycharm

hello锛宨 have faced a similar problem, look like this:

D:Anacondapython.exe E:/pytorch_scratch/optuna_example.py
Traceback (most recent call last):
File "E:/pytorch_scratch/optuna_example.py", line 16, in
study = optuna.create_study()
AttributeError: module 'optuna' has no attribute 'create_study'

an interesting phenomenon is that when I run this code in Jupyter, it works well, but this error occurred when I run this demo in Pycharm

I have finished this problem, please check the name of the file. The reason i met the problem is that there is a file named optuna.py.

Was this page helpful?
0 / 5 - 0 ratings