我试着在jupyter笔记本上运行https://github.com/AppliedDataSciencePartners/DeepReinforcementLearning,在执行这个块之前一切都很好。你知道吗
from game import Game
from funcs import playMatchesBetweenVersions
import loggers as lg
env = Game()
playMatchesBetweenVersions(env, 2, -1, 26, 1, lg.logger_tourney,0, 1)
其中重要的一点是-1对于一个人类玩家来说,如果我运行这个,就会发生这种情况。Ask for imput
当输入一个有效的输入时,就会发生这种情况。IndexError: only integers, slices (^{
在文件中
第26行
action
变量的类型为string。需要将action
变量转换为int进行索引。你知道吗应该是的
将第26行改为:
action=int(input("Enter your chosen answer: "))
正如我在评论中提到的。你知道吗
相关问题 更多 >
编程相关推荐