Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
neurips2020-flatland-starter-kit
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
adrian_egli
neurips2020-flatland-starter-kit
Commits
8eb24851
Commit
8eb24851
authored
4 years ago
by
Egli Adrian (IT-SCI-API-PFI)
Browse files
Options
Downloads
Patches
Plain Diff
fix loading (CPU)
parent
5c8a88cf
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
reinforcement_learning/dddqn_policy.py
+2
-2
2 additions, 2 deletions
reinforcement_learning/dddqn_policy.py
run.py
+2
-2
2 additions, 2 deletions
run.py
with
4 additions
and
4 deletions
reinforcement_learning/dddqn_policy.py
+
2
−
2
View file @
8eb24851
...
@@ -128,10 +128,10 @@ class DDDQNPolicy(Policy):
...
@@ -128,10 +128,10 @@ class DDDQNPolicy(Policy):
def
load
(
self
,
filename
):
def
load
(
self
,
filename
):
try
:
try
:
if
os
.
path
.
exists
(
filename
+
"
.local
"
)
and
os
.
path
.
exists
(
filename
+
"
.target
"
):
if
os
.
path
.
exists
(
filename
+
"
.local
"
)
and
os
.
path
.
exists
(
filename
+
"
.target
"
):
self
.
qnetwork_local
.
load_state_dict
(
torch
.
load
(
filename
+
"
.local
"
))
self
.
qnetwork_local
.
load_state_dict
(
torch
.
load
(
filename
+
"
.local
"
,
map_location
=
self
.
device
))
print
(
"
qnetwork_local loaded (
'
{}
'
)
"
.
format
(
filename
+
"
.local
"
))
print
(
"
qnetwork_local loaded (
'
{}
'
)
"
.
format
(
filename
+
"
.local
"
))
if
not
self
.
evaluation_mode
:
if
not
self
.
evaluation_mode
:
self
.
qnetwork_target
.
load_state_dict
(
torch
.
load
(
filename
+
"
.target
"
))
self
.
qnetwork_target
.
load_state_dict
(
torch
.
load
(
filename
+
"
.target
"
,
map_location
=
self
.
device
))
print
(
"
qnetwork_target loaded (
'
{}
'
)
"
.
format
(
filename
+
"
.target
"
))
print
(
"
qnetwork_target loaded (
'
{}
'
)
"
.
format
(
filename
+
"
.target
"
))
else
:
else
:
print
(
"
>> Checkpoint not found, using untrained policy! (
'
{}
'
,
'
{}
'
)
"
.
format
(
filename
+
"
.local
"
,
print
(
"
>> Checkpoint not found, using untrained policy! (
'
{}
'
,
'
{}
'
)
"
.
format
(
filename
+
"
.local
"
,
...
...
This diff is collapsed.
Click to expand it.
run.py
+
2
−
2
View file @
8eb24851
...
@@ -26,14 +26,14 @@ from reinforcement_learning.dddqn_policy import DDDQNPolicy
...
@@ -26,14 +26,14 @@ from reinforcement_learning.dddqn_policy import DDDQNPolicy
VERBOSE
=
True
VERBOSE
=
True
# Checkpoint to use (remember to push it!)
# Checkpoint to use (remember to push it!)
checkpoint
=
"
./checkpoints/2011
0623490
0-5400.pth
"
# 15.64082361736683 Depth 1
checkpoint
=
"
./checkpoints/2011
1117534
0-5400.pth
"
# Use last action cache
# Use last action cache
USE_ACTION_CACHE
=
False
USE_ACTION_CACHE
=
False
USE_DEAD_LOCK_AVOIDANCE_AGENT
=
False
USE_DEAD_LOCK_AVOIDANCE_AGENT
=
False
# Observation parameters (must match training parameters!)
# Observation parameters (must match training parameters!)
observation_tree_depth
=
1
observation_tree_depth
=
2
observation_radius
=
10
observation_radius
=
10
observation_max_path_depth
=
30
observation_max_path_depth
=
30
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment