Coder Social home page Coder Social logo

ppo_compiler_gym's People

Contributors

ymahlau avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ppo_compiler_gym's Issues

can not run ppo.py

when i use python ppo.py to run the program,i meet the error. Do you know how to fix it? thank you!
image

cannot run the ppo for the benchmark

Hi,
I try to reproduce the PPO result. But the script reports error "size mismatch for features.0.weight: copying a param with shape torch.Size([128, 57]) from checkpoint, the shape in current model is torch.Size([128, 56]).:,

I traced the ppo.py and found the parameter "steps_in_observation" is different for training and evaluation, which results different observation_space sizes. So evaluatioin cannot load the parameters.

class Evaluation:
steps_in_observation=False

Training:
steps_in_observation=True

Traceback (most recent call last):
File "/Users/yuanpeng/cloud/compiler/ppo/ppo.py", line 257, in
ppo_training.train(log_progress=True, training_time=60, progress_log_rate=30)
File "/Users/yuanpeng/cloud/compiler/ppo/ppo.py", line 169, in train
geo_maxima, geo_averages = Evaluation.evaluate(benchmarks, self.name, print_progress=False,
File "/Users/yuanpeng/cloud/compiler/ppo/ppo.py", line 70, in evaluate
model.load_state_dict(torch.load("models/{0}.model".format(model_name)), strict=False)
File "/Users/yuanpeng/cloud/ENTER/envs/pytorch/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1497, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for policy_critic_network:
size mismatch for features.0.weight: copying a param with shape torch.Size([128, 57]) from checkpoint, the shape in current model is torch.Size([128, 56]).

how to train new model?

I use llvm-11.1.0 to build compiler_gym, the pass list has changed, and the model cannot be loaded directly.

  File "/home/relay/wuminghui03/workspace/ppo/ppo_compiler_gym/venv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 2041, in load_state_dict
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for policy_critic_network:
	size mismatch for action_lin.weight: copying a param with shape torch.Size([124, 128]) from checkpoint, the shape in current model is torch.Size([129, 128]).
	size mismatch for action_lin.bias: copying a param with shape torch.Size([124]) from checkpoint, the shape in current model is torch.Size([129]).

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.