Comments (2)
你的dqn_dnn代码里的save/load参数这块是没有问题的,示例可以参考Paddle官网 fluid.io
问题出在你在train和test分别建立了两个model,它们的参数名是不一样的,我在Fluid 1.3.0跑你的dqn_dnn,像下面一样跑完train后,用test的model去load的话是会抛出找不到参数错误的。
train()
test()
如果你是跑完train后,像下面一样进行测试的话是没问题的,因为这时候只创建了一个model,参数名是会和训练时创建的model 的参数名一致,测试结果也和训练后得到的最优解一致
#train()
test()
你可以通过Model里的parameter_names属性进行查看参数名,例如下面:
model1 = MazeModel()
print(model1. parameter_names)
# model1 (相当于你代码里train里面model)参数:[fc.w_0, fc.b_0, fc.w_1, fc.b_1, fc.w_2, fc.b_2]
model2 = MazeModel()
print(model2. parameter_names)
# model2(相当于你代码里test里面model)参数: [fc.w_3, fc.b_3, fc.w_4, fc.b_4, fc.w_5, fc.b_5]
from parl.
谢谢,更新了paddle库,可以了
from parl.
Related Issues (20)
- import parl时报错RuntimeError问题 HOT 1
- A2C模型训练报错 HOT 1
- train.py导入parl时报错怎么解决 HOT 6
- 运行lesson3的课件代码,无法显示平衡杆的图像效果 HOT 4
- PARL在MacOS系统上用pip安装的时候报错 HOT 2
- LESSON5中的DDPG,将PyCharm中提示未实现抽象函数的类都实现后,reward一直处于10左右
- 救命,安装需要的环境包的时候没有一个包安得上,换了ali的源也一样,ubuntu18.04
- pip安装parl时报错
- 电气研究生跨考控制之我真是小白!!! HOT 1
- import parl时RuntimeError HOT 2
- 询问gym库中OBS对象属性的问题
- 使用python train.py运行tutorials中的代码没有反应
- 渲染图像render=True时,代码报错,图像框一下子闪退 Windows10 HOT 1
- torch的选择问题? HOT 2
- DDPG mujoco error
- It seems `fluid` is absent from paddlepaddle after 2.5, causing issue with backend detection on Windows HOT 1
- Attributerror HOT 6
- pip安装问题 HOT 4
- 分发本地文件如何同步更新呢 HOT 1
- Remaining issues of CI HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parl.