Giter VIP home page Giter VIP logo

Comments (2)

zenghsh3 avatar zenghsh3 commented on July 20, 2024

你的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.

kosoraYintai avatar kosoraYintai commented on July 20, 2024

谢谢,更新了paddle库,可以了

from parl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.