不知道该在哪里发布,所以...
我怀疑我的Tensorforce代理未按预期运行...每次尝试提高屏幕快照(状态)分辨率时,它都会在RTX 2060 GPU上显示ResourceExhaustedError ...我想改善我的代码的效率,但是真的不知道该怎么做。
代码:
def agent_build():
#try:
# agent = DQN.restore_model(join(getcwd(), "models"))
#except:
if True:
network = [
#dict(type='conv1d', size=256, window=1, stride=1),
dict(type='flatten'),
dict(type='dueling', size=256, activation='swish'),
dict(type='dense', size=256, activation='swish')
]
print("Creating agent.")
agent = DQN(
states=dict(type='float', #Int may be more appropriate...
shape=(screen_size()[1], screen_size()[0])),
actions=dict(type='int', num_actions=2000),
network=network,
update_mode = dict(units='episodes', batch_size=2, frequency=2),
batching_capacity = 256
)
return agent
def smart_rewarder_build():
network = [
dict(type='flatten'),
dict(type='dense', size=64, activation='swish'),
dict(type='dense', size=64, activation='swish')
]
agent = DQN(
states = dict(type='float', #Int may be more appropriate...
shape=(screen_size()[1], screen_size()[0])),
actions = dict(type = 'int', num_actions=11), # -5...10
network=network
)
return agent
错误消息:
2019-03-03 05:51:39.337780: W tensorflow/core/framework
/op_kernel.cc:1273] OP_REQUIRES failed at random_op.cc:202 : Resource
exhausted: OOM when allocating tensor with shape[32000,162,288] and type
float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator
GPU_0_bfc