Comments (10)
Thanks for opening the issue. Could you provide with a minimal example so that we investigate?
from pilco.
I'm simply using the example - PILCO/tests/test_predictions.py
.
I tested on CPU and GPU version of both tensorflow 1.13.1 and 1.14.0. There was no problem for CPU tensorflow, but no luck on GPU version. My guess is that the problem occurred when the function predict_given_factorization passing through the autoflow of GPflow.
from pilco.
BTW, if possible, can you implement a GPytorch version? It looks like GPytorch outperforms GPflow in large data scenarios.
from pilco.
Can you try running CORRECTION: PILCO/tests/test_predictions.py
examples/inverted_pendulum.py
with the following changes?
controller = LinearController(state_dim=state_dim, control_dim=control_dim)
instead of
controller = RbfController(state_dim=state_dim, control_dim=control_dim, num_basis_functions=5)
and
pilco = PILCO(X, Y, controller=controller, horizon=10)
instead of
pilco = PILCO(X, Y, controller=controller, horizon=40)
The RL algorithm will probably not converge to any useful policy but I am curious to see if this is a memory or architecture issue.
from pilco.
When we wrote the repo GPytorch
was not as mature as GPflow
. I guess that switching to pytorch
would be a great but unfortunately I might not have the time for such a big change (at least in the foreseeable future...)
from pilco.
I cannot try examples/inverted_pendulum.py
on Jetson TX2, since installing the Mujoco(I actually using Roboschool) environment is excruciating. But I can confirm that the memory is not the issue as the memory usage didn't hike up when running the program.
After a two-day investigation, so far, my impression is that the operations in the function predict_given_fractorization
caused cuda registers usage exceeding the existing resources.
from pilco.
Hi @jaztsong,
I had experience with resource allocation errors but it was memory issues in my case. They arise usually in the backward pass (when calculating gradients), where big matrices, order N^2D^2 with N the number of data points and D the number of dimensions are involved.
You could try something like reducing the number of data points used in the test, (it's a 100 and it's
hard coded, you'd have to change it in a few places) just to make sure it's not because of the demands of the algorithm. Excluding that would point to an issue with GPflow or CUDA (or tensorflow) and how they handle resources on your machine, but I wouldn't really know how to address that.
from pilco.
@kyr-po I actually changed the number of data points to 3, and it still broke. Bummer.
from pilco.
After debugging the code line by line for a few days, I finally solved the problem. It turned out the culprit is that the matrix determinant operation in mgpr.py
on GPU caused some memory issue. The workaround solution I got is to calculate determinant by getting LU decomposition first and calculating the product of the diagonal units as the determinant.
The code can run now without error after the modification. However, the prediction speed is unacceptably high when data point number and output dimension ramp up, e.g., N = 40, D_output = 30.
Anyway, thank you for everyone's input.
from pilco.
Thanks a lot @jaztsong for the investigation! I believe that there is quite a big space for improvement in mgpr.py
. Hopefully I will find time at some point to optimize it...
from pilco.
Related Issues (20)
- Computation of cross-covariance of state and action
- Question about MGPR.
- Error with cloudpickle
- Computation time for policy optimization HOT 3
- Reference for predicting with uncertain inputs with SMGPR HOT 1
- Gradient based policy optimisation. HOT 4
- SMGPR : the induced points are different for each model HOT 1
- calculate_factorizations question HOT 1
- Cost for trajectory following HOT 3
- Cholesky decomposition was not successful. The input might not be valid. HOT 2
- [BUG] mountain_car.py fails due to missing import
- What is the V for in the predict_given_factorizations HOT 1
- installation: issue with gast, tensorflow HOT 6
- How do you save your trained model? HOT 2
- Could you please share exact version of some dependency packages
- Performance issue in the definition of create_models, pilco/controllers.py(P1)
- AttributeError: 'Parameter' object has no attribute 'value'
- NotImplementedError: Cannot convert a symbolic (graph mode) `DeferredTensor` to a numpy array. HOT 2
- Is squash_sin() right? HOT 1
- Bugs in model update? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pilco.