princeton-vl / CornerNet

BSD 3-Clause "New" or "Revised" License
2.36k stars 475 forks source link

RuntimeError: CUDA error (10): invalid device ordinal #116

Open JunaidRana opened 5 years ago

JunaidRana commented 5 years ago

I am working on Unity ml-agents. I want to run MADDPG for my project. I have installed torch, torch is able to detect the gpu in machine. i am getting this error. Any help would be appreciated.

RuntimeError Traceback (most recent call last)

in 19 BOOTSTRAP_SIZE=4, 20 LR_CRITIC = 3e-4, ---> 21 LR_ACTOR = 3e-4) 22 23 noises = [SimpleNoise(action_size, scale=1) for i in range(int(states.shape[1]))] ~\Downloads\New folder\ml-agents-master\notebooks\utils.py in __init__(self, state_size, action_size, num_agents, memory, network, device, GRADIENT_CLIP, ACTIVATION, BOOTSTRAP_SIZE, GAMMA, TAU, LR_CRITIC, LR_ACTOR, UPDATE_EVERY, TRANSFER_EVERY, UPDATE_LOOP, ADD_NOISE_EVERY, WEIGHT_DECAY) 57 # Actor networks 58 ---> 59 self.network_local = network(state_size, action_size, state_size * 2 , activation = ACTIVATION).to(device) 60 self.network_target = network(state_size, action_size, state_size * 2 , activation = ACTIVATION).to(device) 61 self.actor_optim = optim.Adam(self.network_local.actor.parameters(), lr=LR_CRITIC, weight_decay=WEIGHT_DECAY) ~\Downloads\New folder\ml-agents-master\notebooks\utils.py in __init__(self, state_size, action_size, full_state_size, activation) 239 def __init__(self, state_size, action_size, full_state_size, activation=F.relu): 240 super().__init__() --> 241 self.actor = FullyConnected([state_size, 32, 32, action_size], activation=activation) 242 self.critic = FullyConnected([full_state_size + action_size, 64, 64, 1], activation=activation) 243 ~\Downloads\New folder\ml-agents-master\notebooks\utils.py in __init__(self, hidden_layers_size, activation) 225 super().__init__() 226 self.hidden_layers = nn.ModuleList() --> 227 self.hidden_layers.extend([layer_init(nn.Linear(hidden_layers_size[i], hidden_layers_size[i + 1])) for i in range(len(hidden_layers_size) - 1)]) 228 layer_init(self.hidden_layers[-1], 1e-3) 229 self.activation = activation ~\Downloads\New folder\ml-agents-master\notebooks\utils.py in (.0) 225 super().__init__() 226 self.hidden_layers = nn.ModuleList() --> 227 self.hidden_layers.extend([layer_init(nn.Linear(hidden_layers_size[i], hidden_layers_size[i + 1])) for i in range(len(hidden_layers_size) - 1)]) 228 layer_init(self.hidden_layers[-1], 1e-3) 229 self.activation = activation ~\AppData\Local\Continuum\anaconda3\envs\ml-agents\lib\site-packages\torch\nn\modules\linear.py in __init__(self, in_features, out_features, bias) 39 self.in_features = in_features 40 self.out_features = out_features ---> 41 self.weight = Parameter(torch.Tensor(out_features, in_features)) 42 if bias: 43 self.bias = Parameter(torch.Tensor(out_features)) RuntimeError: CUDA error (10): invalid device ordinal
chordxu commented 4 years ago

I also met this problem, do you solve it? THX