1 回答
TA贡献1752条经验 获得超4个赞
替换了这个:
%%writefile -a submission.py
model = Net()
model = model.float()
model.load_state_dict(state_dict)
model = model.to('cpu')
model = model.eval()
obs = tensor(obs['board']).reshape(1, 1, config.rows, config.columns).float()
obs = obs / 2
action = model(obs)
return int(action)
这样:
submission_ending = ''' model = Net()
model = model.float()
model.load_state_dict(state_dict)
model = model.to('cpu')
model = model.eval()
obs = tensor(obs['board']).reshape(1, 1, config.rows, config.columns).float()
obs = obs / 2
action = model(obs)
return int(action)'''
with open('submission.py', mode='a') as file:
file.write(submission_ending)
添加回答
举报