Omegastick / pytorch-cpp-rl

PyTorch C++ Reinforcement Learning
MIT License
512 stars 86 forks source link

When build under Ubuntu 18 have error "error: ‘double torch::optim::RMSpropOptions::learning_rate_’ is private within this context.."" #16

Closed geotyper closed 5 years ago

geotyper commented 5 years ago

In member function ‘virtual std::vector cpprl::A2C::update(cpprl::RolloutStorage&, float)’: /home/geotyper/CPP_torch/pytorch-cpp-rl-master/src/algorithms/a2c.cpp:39:24: error: ‘double torch::optim::RMSpropOptions::learningrate’ is private within this context optimizer->options.learningrate = original_learning_rate * decay_level;

Omegastick commented 5 years ago

Just got this error on the Windows CI build, but not the Ubuntu one. It's building fine on my home PCs too. Looking into it now.

Maybe an incompatibility with PyTorch 1.3?

Omegastick commented 5 years ago

Looks like https://github.com/pytorch/pytorch/commit/ce3d024727c26bce37103c731cb3f5521bf0ab23 broke it. I'll get a fix up once I've built PyTorch 1.3 on my PC.

geotyper commented 5 years ago

found that if change to optimizer->options.learning_rate(original_learning_rate * decay_level); //options.learningrate compiles without errors

Omegastick commented 5 years ago

Should be fixed in e1844a17427c319f2c823f2a51dfb22e5d8094cf.