小编use*_*938的帖子

谷歌云计算引擎更改为python 3.6

我正在运行python脚本,可以在笔记本电脑上训练CNN,现在想在Google云上运行它。该脚本导入tensorflow和keras,我需要使用Python 3.6

我遵循的步骤是:

  1. 转到计算引擎并使用8cpus创建虚拟机
  2. 我进入了虚拟机,然后看到python版本是2.7

如何将python版本更改为3.6,以便可以安装keras,然后能够运行python脚本?

非常感谢您的帮助

google-compute-engine google-cloud-platform

8
推荐指数
1
解决办法
3124
查看次数

matplotlib 艺术家动画:标题或文本不变

我尝试使用 matplotlib 的 ArtistAnimation。图形的文本和标题应该在每一帧中改变,但它们没有。我已经阅读了大量关于类似问题的帖子,但我仍然不明白解决方案是什么。据我所知,演示没有显示更新的标题。

如果有人知道,我将不胜感激!

import matplotlib.pyplot as plt
import numpy as np
import matplotlib.animation as animation

fig =plt.figure()    
ims=[]

for iternum in range(4):
    plt.title(iternum)
    plt.text(iternum,iternum,iternum)
    ims.append([plt.scatter(np.random.randint(0,10,5), np.random.randint(0,20,5),marker='+'    )])
    #plt.cla()


ani = animation.ArtistAnimation(fig, ims, interval=500, blit=False,
                              repeat_delay=2000)
plt.show()
Run Code Online (Sandbox Code Playgroud)

python animation matplotlib

6
推荐指数
2
解决办法
6802
查看次数