Size Mismatch m1: [8 x 512], m2: [1568 x 512]


I am relatively new to the Field of RL and I’m using pytorch for the first time.

I’m trying to replicate the following code
and make it run ion procgen benchmark (

I added the ‘appropriate’ pieces of code, but I still get a seed Error when I execute the file with the following parameters:
–env-name “procgen:procgen-coinrun-v0” --algo ppo --use-gae --lr 2.5e-4 --clip-param 0.1 --value-loss-coef 0.5 --num-processes 8 --num-steps 128 --num-mini-batch 4 --log-interval 1 --use-linear-lr-decay --entropy-coef 0.01

When I comment out the line related to the ‘env.seed(seed + rank)’ command, from the file, I get a size mismatch Error:

RuntimeError: size mismatch, m1: [8 x 512], m2: [1568 x 512] at /Users/soumith/mc3build/conda-bld/pytorch_1549312653646/work/aten/src/TH/generic/THTensorMath.cpp:940

I would appreciate any help to resolve this issue!

It seems to be a bit weird that a different seed creates a shape mismatch, but I’m not an expert in RL.
Could you post the stack trace once you run into this error and explain how the seed might change the data or parameter shapes?

Hi @ptrblck . Sorry for the late response. I managed to solve this error by changing the sizes of the CNN model.