在pycharm中使用如下代码,不显示图片
graph_cout = optuna.visualization.plot_optimization_history(study)
解决办法:用offline的模式显示绘出的图(plotly有在线和离线两种模式,offline为离线模式),如此会弹出一个plotly生成的网页,这个html网页会保存在当前目录下,如果不指定文件名,文件名默认是’temp-plot.html’,代码如下:
import plotly graph_cout = optuna.visualization.plot_optimization_history(study) plotly.offline.plot(graph_cout)
效果如下:



