Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
marl-flatland
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
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
manavsinghal157
marl-flatland
Commits
25878c72
Commit
25878c72
authored
4 years ago
by
Egli Adrian (IT-SCI-API-PFI)
Browse files
Options
Downloads
Patches
Plain Diff
load message fix
parent
cc46818b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
reinforcement_learning/ppo_agent.py
+3
-1
3 additions, 1 deletion
reinforcement_learning/ppo_agent.py
with
3 additions
and
1 deletion
reinforcement_learning/ppo_agent.py
+
3
−
1
View file @
25878c72
...
@@ -85,7 +85,7 @@ class ActorCriticModel(nn.Module):
...
@@ -85,7 +85,7 @@ class ActorCriticModel(nn.Module):
return
obj
return
obj
def
load
(
self
,
filename
):
def
load
(
self
,
filename
):
print
(
"
load
policy
from file
"
,
filename
)
print
(
"
load
model
from file
"
,
filename
)
self
.
actor
=
self
.
_load
(
self
.
actor
,
filename
+
"
.actor
"
)
self
.
actor
=
self
.
_load
(
self
.
actor
,
filename
+
"
.actor
"
)
self
.
critic
=
self
.
_load
(
self
.
critic
,
filename
+
"
.value
"
)
self
.
critic
=
self
.
_load
(
self
.
critic
,
filename
+
"
.value
"
)
...
@@ -284,6 +284,8 @@ class PPOPolicy(LearningPolicy):
...
@@ -284,6 +284,8 @@ class PPOPolicy(LearningPolicy):
obj
.
load_state_dict
(
torch
.
load
(
filename
,
map_location
=
self
.
device
))
obj
.
load_state_dict
(
torch
.
load
(
filename
,
map_location
=
self
.
device
))
except
:
except
:
print
(
"
>> failed!
"
)
print
(
"
>> failed!
"
)
else
:
print
(
"
>> file not found!
"
)
return
obj
return
obj
def
load
(
self
,
filename
):
def
load
(
self
,
filename
):
...
...
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