ymahlau / ppo_compiler_gym Goto Github PK
View Code? Open in Web Editor NEWSubmission of PPO Implementation for Compiler Gym
License: MIT License
Submission of PPO Implementation for Compiler Gym
License: MIT License
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]).
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]).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.