flow-project / flow Goto Github PK
View Code? Open in Web Editor NEWComputational framework for reinforcement learning in traffic control
License: MIT License
Computational framework for reinforcement learning in traffic control
License: MIT License
Can we use the flow with our own algorithm? I could not able to find env.step()
like function which returns the observation after performing an action a in the state s
From our website:
Flow: a deep reinforcement learning framework for mixed-autonomy traffic
Flow leverages state-of-the-art deep RL libraries and the open-source microsimulator, SUMO, enabling the use of reinforcement learning to design and train controllers in traffic settings.
From our readthedocs:
Flow is a computational framework for deep RL and control experiments for traffic microsimulation.
From the paper title:
Flow: Architecture and Benchmarking for Reinforcement Learning in Traffic Control
Suggestion:
Alternatives:
Let's discuss and, importantly, let's be consistent.
Move website from https://berkeleyflow.github.io/ to https://flow-project.github.io/ and add a re-direct to https://berkeleyflow.github.io/.
When install flow in Ubuntu,
./scripts/setup_sumo_osx.sh <DESIRED_PATH_TO_SUMO> # installs sumo
./setup_sumo_osx.sh: line 4: brew: command not found
Ideas:
Methods such as get_edges
and get_nodes
can be a bit confusing to follow. The tutorials are meant to help understand what is going on, but it would be helpful if someone could thoroughly documenting the docstrings as well.
libsumo
is a feature in the latest versions of sumo that allow us to bypass some of the connection overhead when issuing traci
calls.
What needs to be done:
master
(close to done)libsumo
installation to the setup instructions (this involves using cmake
I believe)libsumo
-- a note here, libsumo
does not allow us to use sumo's gui, which means we will need something like use_libsumo
as an option from SumoParams
at least temporary so that uses can train with libsumo
and test/visulaize with traci
sumo
until the gui is working with libsumo
, and modify the above things accordingly.If I missed anything, feel free to add and discuss.
ld: warning: directory not found for option '-L/opt/local/lib'
Undefined symbols for architecture x86_64:
working on figuring it out
I think @AboudyKreidieh uncovered this bug a while ago, but when running EC2 (or is it all0 experiments with Inflows, the experiments get progressively slower, until an experiment of batch size ~ 40000, itr=300 experiment will take 4 days to run instead of <1/2 day
I tried to run that file : https://github.com/flow-project/flow/blob/master/environment.yml in a dockerfile and I found some conflicts packages ( see the image)
Is the version of matplotlib really important ?
We can use the sublane model of SUMO to let lane changing be a multi-step process rather than an instantaneous one.
Link describing it:
http://sumo.dlr.de/wiki/Simulation/SublaneModel
render is the most common phrase in similar software architectures when specifying whether to use the gui. @eugenevinitsky any thoughts on this? I have something sort of setup, but am hesitant to create a PR if the new change will lead to confusion
Hi,
I have tried to run rllab examples on figure_eight and some issue appeared .
When I run it in the flow-rllab environment
I got this issue:
He doesn't seem to be link to 'ImportError: cannot import name 'logger' line as it works fine on someone else computer and this line still appear.
Thanks
/anaconda/envs/flow-rllab/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: compiletime version 3.6 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.5
return f(*args, **kwds)
/anaconda/envs/flow-rllab/lib/python3.5/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
/anaconda/envs/flow-rllab/lib/python3.5/site-packages/theano/tensor/signal/downsample.py:6: UserWarning: downsample module has been moved to the theano.tensor.signal.pool module.
"downsample module has been moved to the theano.tensor.signal.pool module.")
Traceback (most recent call last):
File "/Users/lucasfischer/rllab-multiagent/rllab/envs/gym_env.py", line 11, in <module>
from gym.wrappers.monitoring import logger as monitor_logger
ImportError: cannot import name 'logger'
python /Users/lucasfischer/rllab-multiagent/scripts/run_experiment_lite.py --log_dir '/Users/lucasfischer/rllab-multiagent/data/local/figure-eight-control/figure-eight-control_2018_09_03_17_19_12_0001' --snapshot_mode 'all' --seed '5' --exp_name 'figure-eight-control_2018_09_03_17_19_12_0001' --variant_data 'gAN9cQBYCAAAAGV4cF9uYW1lcQFYLQAAAGZpZ3VyZS1laWdodC1jb250cm9sXzIwMThfMDlfMDNfMTdfMTlfMTJfMDAwMXECcy4=' --n_parallel '1' --args_data 'gASVIAkAAAAAAACMF2Nsb3VkcGlja2xlLmNsb3VkcGlja2xllIwOX2ZpbGxfZnVuY3Rpb26Uk5QoaACMD19tYWtlX3NrZWxfZnVuY5STlGgAjA1fYnVpbHRpbl90eXBllJOUjAhDb2RlVHlwZZSFlFKUKEsASwBLEEsPS0dC3wEAAHQAAGQBAGQCAGQDAGQEAIMAAn0BAHQBAIMAAH0CAHwCAGoCAGQFAGQGAGQHAHQDAGkAAGYCAGQIAHQEAGkAAGYCAGQJAGQKAGQLAGQMAIMABQF8AgBqAgBkBQBkDQBkBwB0BQBkDgBkDwBpAQBmAgBkCAB0BABpAABmAgBkCQBkCgBkCwBkEACDAAUBZBEAZBIAZBMAZBQAZBUAZBQAaQMAfQMAdAYAZBYAdAcAZBcAfAMAgwACfQQAZBgAZBkAZBoAZAwAZBsAZBkAZBwAZB0AaQQAfQUAdAgAZB4AZB8AZBcAfAUAgwACfQYAdAkAZCAAZCEAgwABfQcAdAoAZCIAdAsAgwIAAXQMAHQLAHQNAHwCAHwGAGQjAHwHAIMEAX0IAGQkAH0JAHwJAHwBAHwCAHwEAHwGAHwHAHwIAGYHAH0KAHQOAHwJAGQlAGQfAGQmAHwKAIMBAn0LAHwLAGoPAH0MAHQQAHwLAIMBAH0LAHQRAGQnAHwLAGoSAGQoAGQ0AIMAAn0NAHQTAGQnAHwLAGoSAIMAAX0OAHQUAGQqAHwLAGQrAHwNAGQsAHwOAGQtAGQuAGQvAHwMAGQwAGQxAGQyAGQzAIMAB30PAHwPAGoVAIMAAGYBAAFkAABTlChOjAhzaW1fc3RlcJRHP7mZmZmZmZqMC3N1bW9fYmluYXJ5lIwIc3Vtby1ndWmUjAZ2ZWhfaWSUjAJybJSMF2FjY2VsZXJhdGlvbl9jb250cm9sbGVylIwScm91dGluZ19jb250cm9sbGVylIwKc3BlZWRfbW9kZZSMCm5vX2NvbGxpZGWUjAxudW1fdmVoaWNsZXOUSwGMA2lkbZSMBW5vaXNllEc/yZmZmZmZmksNjA90YXJnZXRfdmVsb2NpdHmUSxSMCW1heF9hY2NlbJRLA4wJbWF4X2RlY2VslIwHaG9yaXpvbpSMEWFkZGl0aW9uYWxfcGFyYW1zlIwLcmFkaXVzX3JpbmeUSx6MBWxhbmVzlIwLc3BlZWRfbGltaXSUjApyZXNvbHV0aW9ulEsojBFub19pbnRlcm5hbF9saW5rc5SJjAdzcGFjaW5nlIwHdW5pZm9ybZSMCFhYWCBuYW1llIwOaW5pdGlhbF9jb25maWeUjAhBY2NlbEVudpSMDHJlY29yZF92aWRlb5SMD3JlZ2lzdGVyX3BhcmFtc5SMCGVudl9zcGVjlIwMaGlkZGVuX3NpemVzlEsQjANlbnaUjAZwb2xpY3mUjAhiYXNlbGluZZSMCmJhdGNoX3NpemWUTZg6jA9tYXhfcGF0aF9sZW5ndGiUjAVuX2l0cpRN9AGMCGRpc2NvdW50lEc/7/fO2RaHK0sQSxCGlHSUKIwKU3Vtb1BhcmFtc5SMCFZlaGljbGVzlIwDYWRklIwMUkxDb250cm9sbGVylIwQQ29udGludW91c1JvdXRlcpSMDUlETUNvbnRyb2xsZXKUjAlFbnZQYXJhbXOUjAdIT1JJWk9OlIwJTmV0UGFyYW1zlIwNSW5pdGlhbENvbmZpZ5SMBXByaW50lIwHZXhwX3RhZ5SMD0ZpZ3VyZThTY2VuYXJpb5SMEEZpZ3VyZThHZW5lcmF0b3KUjAZHeW1FbnaUaBqMCW5vcm1hbGl6ZZSMEUdhdXNzaWFuTUxQUG9saWN5lIwEc3BlY5SMFUxpbmVhckZlYXR1cmVCYXNlbGluZZSMBFRSUE+UjAV0cmFpbpR0lCiMAV+UjAtzdW1vX3BhcmFtc5SMCHZlaGljbGVzlIwVYWRkaXRpb25hbF9lbnZfcGFyYW1zlIwKZW52X3BhcmFtc5SMFWFkZGl0aW9uYWxfbmV0X3BhcmFtc5SMCm5ldF9wYXJhbXOUaCSMCHNjZW5hcmlvlIwIZW52X25hbWWUjAtwYXNzX3BhcmFtc5RoKmgaaCtoLIwEYWxnb5R0lIweZXhhbXBsZXMvcmxsYWIvZmlndXJlX2VpZ2h0LnB5lIwIcnVuX3Rhc2uUSxRDWAABDAEJAgkBDwEMAQwBBgEHAQ8BEgEMAQYBBwIGARIBDAEJAhIBDAEMAQkCDwINARIBCQIGAQ8BDAIYAQkBDAIGAQkBCQMSAgYBBgEGAQYBBgEGAQYCCQOUKSl0lFKUSv////99lIeUUpR9lCiMDmNsb3N1cmVfdmFsdWVzlE6MBm1vZHVsZZSMCF9fbWFpbl9flIwEZGljdJR9lIwIcXVhbG5hbWWUaFaMB2dsb2JhbHOUfZQoaEKMGXJsbGFiLmVudnMubm9ybWFsaXplZF9lbnaUjA1Ob3JtYWxpemVkRW52lJOUaECMGmZsb3cuc2NlbmFyaW9zLmZpZ3VyZTguZ2VulGhAk5RoQ4wicmxsYWIucG9saWNpZXMuZ2F1c3NpYW5fbWxwX3BvbGljeZRoQ5OUaDuMEGZsb3cuY29yZS5wYXJhbXOUaDuTlGg4jCVmbG93LmNvbnRyb2xsZXJzLmNhcl9mb2xsb3dpbmdfbW9kZWxzlGg4k5RoPowUZmlndXJlLWVpZ2h0LWNvbnRyb2yUaDpN3AVoQYwScmxsYWIuZW52cy5neW1fZW52lGhBk5RoN4wkZmxvdy5jb250cm9sbGVycy5yb3V0aW5nX2NvbnRyb2xsZXJzlGg3k5RoP4wnZmxvdy5zY2VuYXJpb3MuZmlndXJlOC5maWd1cmU4X3NjZW5hcmlvlGg/k5RoOWhtaDmTlGgzaG1oM5OUaEWMJ3JsbGFiLmJhc2VsaW5lcy5saW5lYXJfZmVhdHVyZV9iYXNlbGluZZRoRZOUaDSMEmZsb3cuY29yZS52ZWhpY2xlc5RoNJOUaDaMHWZsb3cuY29udHJvbGxlcnMucmxjb250cm9sbGVylGg2k5RoRowQcmxsYWIuYWxnb3MudHJwb5RoRpOUaDxobWg8k5R1jAhkZWZhdWx0c5ROdXRSLg==' --use_cloudpickle 'True'
/anaconda/envs/flow-rllab/lib/python3.5/site-packages/theano/tensor/signal/downsample.py:6: UserWarning: downsample module has been moved to the theano.tensor.signal.pool module.
"downsample module has been moved to the theano.tensor.signal.pool module.")
/anaconda/envs/flow-rllab/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: compiletime version 3.6 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.5
return f(*args, **kwds)
/anaconda/envs/flow-rllab/lib/python3.5/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
using seed 5
2018-09-03 17:19:19.694379 PDT | Setting seed to 5
using seed 5
Traceback (most recent call last):
File "/Users/lucasfischer/rllab-multiagent/rllab/envs/gym_env.py", line 11, in <module>
from gym.wrappers.monitoring import logger as monitor_logger
ImportError: cannot import name 'logger'
XXX name figure-eight-control
Loading configuration... done.
Success.
Loading configuration... done.
2018-09-03 17:19:33.091563 PDT | [figure-eight-control_2018_09_03_17_19_12_0001] observation space: <rllab.spaces.product.Product object at 0x1278e4390>
2018-09-03 17:19:33.092035 PDT | [figure-eight-control_2018_09_03_17_19_12_0001] action space: Box(1,)
WARNING (theano.gof.compilelock): Overriding existing lock by dead process '8452' (I am process '8606')
WARNING:theano.gof.compilelock:Overriding existing lock by dead process '8452' (I am process '8606')
===============================
00001 #include <Python.h>
00002 #include <iostream>
00003 #include "theano_mod_helper.h"
00004 #include <math.h>
00005 #include <numpy/arrayobject.h>
00006 #include <numpy/arrayscalars.h>
00007 #include <vector>
00008 #include <algorithm>
00009 //////////////////////
00010 //// Support Code
00011 //////////////////////
00012
00013
00014 namespace {
00015 struct __struct_compiled_op_m7e2defd3cf256d1cfbc2cdcfd979dff0 {
00016 PyObject* __ERROR;
00017
00018 PyObject* storage_V3;
00019 PyObject* storage_V5;
00020 PyObject* storage_V1;
00021
00022
00023 __struct_compiled_op_m7e2defd3cf256d1cfbc2cdcfd979dff0() {
00024 // This is only somewhat safe because we:
00025 // 1) Are not a virtual class
00026 // 2) Do not use any virtual classes in the members
00027 // 3) Deal with mostly POD and pointers
00028
00029 // If this changes, we would have to revise this, but for
00030 // now I am tired of chasing segfaults because
00031 // initialization code had an error and some pointer has
00032 // a junk value.
00033 memset(this, 0, sizeof(*this));
00034 }
00035 ~__struct_compiled_op_m7e2defd3cf256d1cfbc2cdcfd979dff0(void) {
00036 cleanup();
00037 }
00038
00039 int init(PyObject* __ERROR, PyObject* storage_V3, PyObject* storage_V5, PyObject* storage_V1) {
00040 Py_XINCREF(storage_V3);
00041 Py_XINCREF(storage_V5);
00042 Py_XINCREF(storage_V1);
00043 this->storage_V3 = storage_V3;
00044 this->storage_V5 = storage_V5;
00045 this->storage_V1 = storage_V1;
00046
00047
00048
00049
00050
00051 this->__ERROR = __ERROR;
00052 return 0;
00053 }
00054 void cleanup(void) {
00055 __label_1:
00056
00057 double __DUMMY_1;
00058 __label_3:
00059
00060 double __DUMMY_3;
00061 __label_5:
00062
00063 double __DUMMY_5;
00064 __label_8:
00065
00066 double __DUMMY_8;
00067
00068 Py_XDECREF(this->storage_V3);
00069 Py_XDECREF(this->storage_V5);
00070 Py_XDECREF(this->storage_V1);
00071 }
00072 int run(void) {
00073 int __failure = 0;
00074
00075 PyObject* py_V1;
00076
00077 PyArrayObject* V1;
00078
00079 typedef npy_float64 dtype_V1;
00080
00081 PyObject* py_V3;
00082
00083 PyArrayObject* V3;
00084
00085 typedef npy_float64 dtype_V3;
00086
00087 PyObject* py_V5;
00088
00089 PyArrayObject* V5;
00090
00091 typedef npy_float64 dtype_V5;
00092
00093 {
00094
00095 py_V1 = PyList_GET_ITEM(storage_V1, 0);
00096 {Py_XINCREF(py_V1);}
00097
00098 if (py_V1 == Py_None)
00099 {
00100
00101 V1 = NULL;
00102
00103 }
00104 else
00105 {
00106
00107 V1 = NULL;
00108 if (py_V1 == Py_None) {
00109 // We can either fail here or set V1 to NULL and rely on Ops
00110 // using tensors to handle the NULL case, but if they fail to do so
00111 // they'll end up with nasty segfaults, so this is public service.
00112 PyErr_SetString(PyExc_ValueError, "expected an ndarray, not None");
00113 {
00114 __failure = 2;
00115 if (!PyErr_Occurred()) {
00116 PyErr_SetString(PyExc_RuntimeError,
00117 "Unexpected error in an Op's C code. "
00118 "No Python exception was set.");
00119 }
00120 goto __label_2;}
00121 }
00122 if (!PyArray_Check(py_V1)) {
00123 PyErr_SetString(PyExc_ValueError, "expected an ndarray");
00124 {
00125 __failure = 2;
00126 if (!PyErr_Occurred()) {
00127 PyErr_SetString(PyExc_RuntimeError,
00128 "Unexpected error in an Op's C code. "
00129 "No Python exception was set.");
00130 }
00131 goto __label_2;}
00132 }
00133 // We expect NPY_FLOAT64
00134 if (!PyArray_ISALIGNED((PyArrayObject*) py_V1)) {
00135 PyArrayObject * tmp = (PyArrayObject*) py_V1;
00136 PyErr_Format(PyExc_NotImplementedError,
00137 "expected an aligned array of type %ld "
00138 "(NPY_FLOAT64), got non-aligned array of type %ld"
00139 " with %ld dimensions, with 3 last dims "
00140 "%ld, %ld, %ld"
00141 " and 3 last strides %ld %ld, %ld.",
00142 (long int) NPY_FLOAT64,
00143 (long int) PyArray_TYPE((PyArrayObject*) py_V1),
00144 (long int) PyArray_NDIM(tmp),
00145 (long int) PyArray_NDIM(tmp) >= 3 ?
00146 PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-3] : -1,
00147 (long int) PyArray_NDIM(tmp) >= 2 ?
00148 PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-2] : -1,
00149 (long int) PyArray_NDIM(tmp) >= 1 ?
00150 PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-1] : -1,
00151 (long int) PyArray_NDIM(tmp) >= 3 ?
00152 PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-3] : -1,
00153 (long int) PyArray_NDIM(tmp) >= 2 ?
00154 PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-2] : -1,
00155 (long int) PyArray_NDIM(tmp) >= 1 ?
00156 PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-1] : -1
00157 );
00158 {
00159 __failure = 2;
00160 if (!PyErr_Occurred()) {
00161 PyErr_SetString(PyExc_RuntimeError,
00162 "Unexpected error in an Op's C code. "
00163 "No Python exception was set.");
00164 }
00165 goto __label_2;}
00166 }
00167 // This is a TypeError to be consistent with DEBUG_MODE
00168 // Note: DEBUG_MODE also tells the name of the container
00169 if (PyArray_TYPE((PyArrayObject*) py_V1) != NPY_FLOAT64) {
00170 PyErr_Format(PyExc_TypeError,
00171 "expected type_num %d (NPY_FLOAT64) got %d",
00172 NPY_FLOAT64, PyArray_TYPE((PyArrayObject*) py_V1));
00173 {
00174 __failure = 2;
00175 if (!PyErr_Occurred()) {
00176 PyErr_SetString(PyExc_RuntimeError,
00177 "Unexpected error in an Op's C code. "
00178 "No Python exception was set.");
00179 }
00180 goto __label_2;}
00181 }
00182
00183 V1 = (PyArrayObject*)(py_V1);
00184 Py_XINCREF(V1);
00185
00186 }
00187
00188 {
00189
00190 py_V3 = PyList_GET_ITEM(storage_V3, 0);
00191 {Py_XINCREF(py_V3);}
00192
00193 V3 = NULL;
00194 if (py_V3 == Py_None) {
00195 // We can either fail here or set V3 to NULL and rely on Ops
00196 // using tensors to handle the NULL case, but if they fail to do so
00197 // they'll end up with nasty segfaults, so this is public service.
00198 PyErr_SetString(PyExc_ValueError, "expected an ndarray, not None");
00199 {
00200 __failure = 4;
00201 if (!PyErr_Occurred()) {
00202 PyErr_SetString(PyExc_RuntimeError,
00203 "Unexpected error in an Op's C code. "
00204 "No Python exception was set.");
00205 }
00206 goto __label_4;}
00207 }
00208 if (!PyArray_Check(py_V3)) {
00209 PyErr_SetString(PyExc_ValueError, "expected an ndarray");
00210 {
00211 __failure = 4;
00212 if (!PyErr_Occurred()) {
00213 PyErr_SetString(PyExc_RuntimeError,
00214 "Unexpected error in an Op's C code. "
00215 "No Python exception was set.");
00216 }
00217 goto __label_4;}
00218 }
00219 // We expect NPY_FLOAT64
00220 if (!PyArray_ISALIGNED((PyArrayObject*) py_V3)) {
00221 PyArrayObject * tmp = (PyArrayObject*) py_V3;
00222 PyErr_Format(PyExc_NotImplementedError,
00223 "expected an aligned array of type %ld "
00224 "(NPY_FLOAT64), got non-aligned array of type %ld"
00225 " with %ld dimensions, with 3 last dims "
00226 "%ld, %ld, %ld"
00227 " and 3 last strides %ld %ld, %ld.",
00228 (long int) NPY_FLOAT64,
00229 (long int) PyArray_TYPE((PyArrayObject*) py_V3),
00230 (long int) PyArray_NDIM(tmp),
00231 (long int) PyArray_NDIM(tmp) >= 3 ?
00232 PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-3] : -1,
00233 (long int) PyArray_NDIM(tmp) >= 2 ?
00234 PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-2] : -1,
00235 (long int) PyArray_NDIM(tmp) >= 1 ?
00236 PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-1] : -1,
00237 (long int) PyArray_NDIM(tmp) >= 3 ?
00238 PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-3] : -1,
00239 (long int) PyArray_NDIM(tmp) >= 2 ?
00240 PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-2] : -1,
00241 (long int) PyArray_NDIM(tmp) >= 1 ?
00242 PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-1] : -1
00243 );
00244 {
00245 __failure = 4;
00246 if (!PyErr_Occurred()) {
00247 PyErr_SetString(PyExc_RuntimeError,
00248 "Unexpected error in an Op's C code. "
00249 "No Python exception was set.");
00250 }
00251 goto __label_4;}
00252 }
00253 // This is a TypeError to be consistent with DEBUG_MODE
00254 // Note: DEBUG_MODE also tells the name of the container
00255 if (PyArray_TYPE((PyArrayObject*) py_V3) != NPY_FLOAT64) {
00256 PyErr_Format(PyExc_TypeError,
00257 "expected type_num %d (NPY_FLOAT64) got %d",
00258 NPY_FLOAT64, PyArray_TYPE((PyArrayObject*) py_V3));
00259 {
00260 __failure = 4;
00261 if (!PyErr_Occurred()) {
00262 PyErr_SetString(PyExc_RuntimeError,
00263 "Unexpected error in an Op's C code. "
00264 "No Python exception was set.");
00265 }
00266 goto __label_4;}
00267 }
00268
00269 V3 = (PyArrayObject*)(py_V3);
00270 Py_XINCREF(V3);
00271
00272 {
00273
00274 py_V5 = PyList_GET_ITEM(storage_V5, 0);
00275 {Py_XINCREF(py_V5);}
00276
00277 V5 = NULL;
00278 if (py_V5 == Py_None) {
00279 // We can either fail here or set V5 to NULL and rely on Ops
00280 // using tensors to handle the NULL case, but if they fail to do so
00281 // they'll end up with nasty segfaults, so this is public service.
00282 PyErr_SetString(PyExc_ValueError, "expected an ndarray, not None");
00283 {
00284 __failure = 6;
00285 if (!PyErr_Occurred()) {
00286 PyErr_SetString(PyExc_RuntimeError,
00287 "Unexpected error in an Op's C code. "
00288 "No Python exception was set.");
00289 }
00290 goto __label_6;}
00291 }
00292 if (!PyArray_Check(py_V5)) {
00293 PyErr_SetString(PyExc_ValueError, "expected an ndarray");
00294 {
00295 __failure = 6;
00296 if (!PyErr_Occurred()) {
00297 PyErr_SetString(PyExc_RuntimeError,
00298 "Unexpected error in an Op's C code. "
00299 "No Python exception was set.");
00300 }
00301 goto __label_6;}
00302 }
00303 // We expect NPY_FLOAT64
00304 if (!PyArray_ISALIGNED((PyArrayObject*) py_V5)) {
00305 PyArrayObject * tmp = (PyArrayObject*) py_V5;
00306 PyErr_Format(PyExc_NotImplementedError,
00307 "expected an aligned array of type %ld "
00308 "(NPY_FLOAT64), got non-aligned array of type %ld"
00309 " with %ld dimensions, with 3 last dims "
00310 "%ld, %ld, %ld"
00311 " and 3 last strides %ld %ld, %ld.",
00312 (long int) NPY_FLOAT64,
00313 (long int) PyArray_TYPE((PyArrayObject*) py_V5),
00314 (long int) PyArray_NDIM(tmp),
00315 (long int) PyArray_NDIM(tmp) >= 3 ?
00316 PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-3] : -1,
00317 (long int) PyArray_NDIM(tmp) >= 2 ?
00318 PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-2] : -1,
00319 (long int) PyArray_NDIM(tmp) >= 1 ?
00320 PyArray_DIMS(tmp)[PyArray_NDIM(tmp)-1] : -1,
00321 (long int) PyArray_NDIM(tmp) >= 3 ?
00322 PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-3] : -1,
00323 (long int) PyArray_NDIM(tmp) >= 2 ?
00324 PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-2] : -1,
00325 (long int) PyArray_NDIM(tmp) >= 1 ?
00326 PyArray_STRIDES(tmp)[PyArray_NDIM(tmp)-1] : -1
00327 );
00328 {
00329 __failure = 6;
00330 if (!PyErr_Occurred()) {
00331 PyErr_SetString(PyExc_RuntimeError,
00332 "Unexpected error in an Op's C code. "
00333 "No Python exception was set.");
00334 }
00335 goto __label_6;}
00336 }
00337 // This is a TypeError to be consistent with DEBUG_MODE
00338 // Note: DEBUG_MODE also tells the name of the container
00339 if (PyArray_TYPE((PyArrayObject*) py_V5) != NPY_FLOAT64) {
00340 PyErr_Format(PyExc_TypeError,
00341 "expected type_num %d (NPY_FLOAT64) got %d",
00342 NPY_FLOAT64, PyArray_TYPE((PyArrayObject*) py_V5));
00343 {
00344 __failure = 6;
00345 if (!PyErr_Occurred()) {
00346 PyErr_SetString(PyExc_RuntimeError,
00347 "Unexpected error in an Op's C code. "
00348 "No Python exception was set.");
00349 }
00350 goto __label_6;}
00351 }
00352
00353 V5 = (PyArrayObject*)(py_V5);
00354 Py_XINCREF(V5);
00355
00356 {
00357 // Op class Elemwise
00358
00359 npy_float64* V3_iter;
00360
00361 npy_intp V3_n0;
00362 ssize_t V3_stride0;
00363 int V3_jump0_0;
00364
00365 npy_intp V3_n1;
00366 ssize_t V3_stride1;
00367 int V3_jump1_1;
00368
00369 npy_float64* V5_iter;
00370
00371 int V5_jumpx_0;
00372
00373 npy_intp V5_n1;
00374 ssize_t V5_stride1;
00375 int V5_jump1_1;
00376
00377
00378 if (PyArray_NDIM(V3) < 2) {
00379 PyErr_SetString(PyExc_ValueError, "Not enough dimensions on input.");
00380 {
00381 __failure = 7;
00382 if (!PyErr_Occurred()) {
00383 PyErr_SetString(PyExc_RuntimeError,
00384 "Unexpected error in an Op's C code. "
00385 "No Python exception was set.");
00386 }
00387 goto __label_7;}
00388 }
00389
00390 V3_n1 = PyArray_DIMS(V3)[1];
00391 V3_stride1 = PyArray_STRIDES(V3)[1] / sizeof(npy_float64);
00392 V3_jump1_1 = (V3_stride1) - (0);
00393 //printf("V3_jump1_1 is:");
00394 //std::cout << V3_jump1_1 << std::endl;
00395
00396 V3_n0 = PyArray_DIMS(V3)[0];
00397 V3_stride0 = PyArray_STRIDES(V3)[0] / sizeof(npy_float64);
00398 V3_jump0_0 = (V3_stride0) - (V3_n1*V3_stride1);
00399 //printf("V3_jump0_0 is:");
00400 //std::cout << V3_jump0_0 << std::endl;
00401
00402 if (PyArray_NDIM(V5) < 2) {
00403 PyErr_SetString(PyExc_ValueError, "Not enough dimensions on input.");
00404 {
00405 __failure = 7;
00406 if (!PyErr_Occurred()) {
00407 PyErr_SetString(PyExc_RuntimeError,
00408 "Unexpected error in an Op's C code. "
00409 "No Python exception was set.");
00410 }
00411 goto __label_7;}
00412 }
00413
00414 V5_n1 = PyArray_DIMS(V5)[1];
00415 V5_stride1 = PyArray_STRIDES(V5)[1] / sizeof(npy_float64);
00416 V5_jump1_1 = (V5_stride1) - (0);
00417 //printf("V5_jump1_1 is:");
00418 //std::cout << V5_jump1_1 << std::endl;
00419
00420 V5_jumpx_0 = -(V5_n1*V5_stride1);
00421 //printf("V5_jumpx_0 is:");
00422 //std::cout << V5_jumpx_0 << std::endl;
00423
00424 if (V3_n1 != V5_n1)
00425 {
00426 PyErr_Format(PyExc_ValueError, "Input dimension mis-match. (input[%i].shape[%i] = %i, input[%i].shape[%i] = %i)",
00427 0,
00428 1,
00429 V3_n1,
00430 1,
00431 1,
00432 V5_n1
00433 );
00434 {
00435 __failure = 7;
00436 if (!PyErr_Occurred()) {
00437 PyErr_SetString(PyExc_RuntimeError,
00438 "Unexpected error in an Op's C code. "
00439 "No Python exception was set.");
00440 }
00441 goto __label_7;}
00442 }
00443
00444
00445 if (V1) {
00446 Py_XDECREF(V1);
00447 }
00448 V1 = V3;
00449 Py_XINCREF(V1);
00450
00451 {
00452
00453 std::vector< std::pair<int, int> > V3_loops(2);
00454 std::vector< std::pair<int, int> >::iterator V3_loops_it = V3_loops.begin();
00455
00456 V3_loops_it->first = abs(PyArray_STRIDES(V3)[0]);
00457
00458 V3_loops_it->second = 0;
00459 ++V3_loops_it;
00460
00461 V3_loops_it->first = abs(PyArray_STRIDES(V3)[1]);
00462
00463 V3_loops_it->second = 1;
00464 ++V3_loops_it;
00465
00466 // rbegin and rend are reversed iterators, so this sorts in decreasing order
00467 std::sort(V3_loops.rbegin(), V3_loops.rend());
00468
00469
00470 int init_totals[2] = {V3_n0, V3_n1};
00471
00472 V3_loops_it = V3_loops.begin();
00473
00474 int TOTAL_0 = init_totals[V3_loops_it->second];
00475 ++V3_loops_it;
00476
00477 int TOTAL_1 = init_totals[V3_loops_it->second];
00478 ++V3_loops_it;
00479
00480
00481 int init_strides[2][2] = {
00482 V3_stride0, V3_stride1,
00483 0, V5_stride1
00484 };
00485 std::vector< std::pair<int, int> >::reverse_iterator V3_loops_rit;
00486
00487 V3_loops_rit = V3_loops.rbegin();
00488 int V3_stride_l1 = init_strides[0][V3_loops_rit->second];
00489 ++V3_loops_rit;
00490
00491 int V3_stride_l0 = init_strides[0][V3_loops_rit->second];
00492 ++V3_loops_rit;
00493
00494 V3_loops_rit = V3_loops.rbegin();
00495 int V5_stride_l1 = init_strides[1][V3_loops_rit->second];
00496 ++V3_loops_rit;
00497
00498 int V5_stride_l0 = init_strides[1][V3_loops_rit->second];
00499 ++V3_loops_rit;
00500
00501 V3_iter = (npy_float64*)(PyArray_DATA(V3));
00502 V5_iter = (npy_float64*)(PyArray_DATA(V5));
00503
00504
00505 for(int ITER_0 = 0; ITER_0<TOTAL_0; ITER_0++)
00506 { // begin loop 0
00507
00508
00509 for(int ITER_1 = 0; ITER_1<TOTAL_1; ITER_1++)
00510 { // begin loop 1
00511 npy_float64 &V3_i = * ( V3_iter+V3_stride_l1*ITER_1+V3_stride_l0*ITER_0);
00512 npy_float64 &V5_i = * ( V5_iter+V5_stride_l1*ITER_1+V5_stride_l0*ITER_0);
00513
00514
00515 {
00516 #define V1_i V3_i
00517 {
00518 npy_float64 V7_tmp1;
00519 V7_tmp1 = V3_i + V5_i;
00520 V1_i = tanh(V7_tmp1);
00521 }
00522
00523 #undef V1_i
00524 }
00525
00526 } // end loop 1
00527
00528 } // end loop 0
00529
00530 }
00531 __label_7:
00532
00533 double __DUMMY_7;
00534
00535 }
00536 __label_6:
00537
00538 if (V5) {
00539 Py_XDECREF(V5);
00540 }
00541
00542 {Py_XDECREF(py_V5);}
00543
00544 double __DUMMY_6;
00545
00546 }
00547 __label_4:
00548
00549 if (V3) {
00550 Py_XDECREF(V3);
00551 }
00552
00553 {Py_XDECREF(py_V3);}
00554
00555 double __DUMMY_4;
00556
00557 }
00558 __label_2:
00559
00560 if (!__failure) {
00561
00562 {Py_XDECREF(py_V1);}
00563 if (!V1) {
00564 Py_INCREF(Py_None);
00565 py_V1 = Py_None;
00566 }
00567 else if ((void*)py_V1 != (void*)V1) {
00568 py_V1 = (PyObject*)V1;
00569 }
00570
00571 {Py_XINCREF(py_V1);}
00572
00573 if (V1 && !PyArray_ISALIGNED((PyArrayObject*) py_V1)) {
00574 PyErr_Format(PyExc_NotImplementedError,
00575 "c_sync: expected an aligned array, got non-aligned array of type %ld"
00576 " with %ld dimensions, with 3 last dims "
00577 "%ld, %ld, %ld"
00578 " and 3 last strides %ld %ld, %ld.",
00579 (long int) PyArray_TYPE((PyArrayObject*) py_V1),
00580 (long int) PyArray_NDIM(V1),
00581 (long int) PyArray_NDIM(V1) >= 3 ?
00582 PyArray_DIMS(V1)[PyArray_NDIM(V1)-3] : -1,
00583 (long int) PyArray_NDIM(V1) >= 2 ?
00584 PyArray_DIMS(V1)[PyArray_NDIM(V1)-2] : -1,
00585 (long int) PyArray_NDIM(V1) >= 1 ?
00586 PyArray_DIMS(V1)[PyArray_NDIM(V1)-1] : -1,
00587 (long int) PyArray_NDIM(V1) >= 3 ?
00588 PyArray_STRIDES(V1)[PyArray_NDIM(V1)-3] : -1,
00589 (long int) PyArray_NDIM(V1) >= 2 ?
00590 PyArray_STRIDES(V1)[PyArray_NDIM(V1)-2] : -1,
00591 (long int) PyArray_NDIM(V1) >= 1 ?
00592 PyArray_STRIDES(V1)[PyArray_NDIM(V1)-1] : -1
00593 );
00594 {
00595 __failure = 2;
00596 if (!PyErr_Occurred()) {
00597 PyErr_SetString(PyExc_RuntimeError,
00598 "Unexpected error in an Op's C code. "
00599 "No Python exception was set.");
00600 }
00601 goto __label_2;}
00602 }
00603
00604 PyObject* old = PyList_GET_ITEM(storage_V1, 0);
00605 {Py_XINCREF(py_V1);}
00606 PyList_SET_ITEM(storage_V1, 0, py_V1);
00607 {Py_XDECREF(old);}
00608 }
00609
00610 if (V1) {
00611 Py_XDECREF(V1);
00612 }
00613
00614 {Py_XDECREF(py_V1);}
00615
00616 double __DUMMY_2;
00617
00618 }
00619
00620
00621 if (__failure) {
00622 // When there is a failure, this code puts the exception
00623 // in __ERROR.
00624 PyObject* err_type = NULL;
00625 PyObject* err_msg = NULL;
00626 PyObject* err_traceback = NULL;
00627 PyErr_Fetch(&err_type, &err_msg, &err_traceback);
00628 if (!err_type) {err_type = Py_None;Py_INCREF(Py_None);}
00629 if (!err_msg) {err_msg = Py_None; Py_INCREF(Py_None);}
00630 if (!err_traceback) {err_traceback = Py_None; Py_INCREF(Py_None);}
00631 PyObject* old_err_type = PyList_GET_ITEM(__ERROR, 0);
00632 PyObject* old_err_msg = PyList_GET_ITEM(__ERROR, 1);
00633 PyObject* old_err_traceback = PyList_GET_ITEM(__ERROR, 2);
00634 PyList_SET_ITEM(__ERROR, 0, err_type);
00635 PyList_SET_ITEM(__ERROR, 1, err_msg);
00636 PyList_SET_ITEM(__ERROR, 2, err_traceback);
00637 {Py_XDECREF(old_err_type);}
00638 {Py_XDECREF(old_err_msg);}
00639 {Py_XDECREF(old_err_traceback);}
00640 }
00641 // The failure code is returned to index what code block failed.
00642 return __failure;
00643
00644 }
00645 };
00646 }
00647
00648
00649 static int __struct_compiled_op_m7e2defd3cf256d1cfbc2cdcfd979dff0_executor(__struct_compiled_op_m7e2defd3cf256d1cfbc2cdcfd979dff0 *self) {
00650 return self->run();
00651 }
00652
00653 static void __struct_compiled_op_m7e2defd3cf256d1cfbc2cdcfd979dff0_destructor(PyObject *capsule) {
00654 __struct_compiled_op_m7e2defd3cf256d1cfbc2cdcfd979dff0 *self = (__struct_compiled_op_m7e2defd3cf256d1cfbc2cdcfd979dff0 *)PyCapsule_GetContext(capsule);
00655 delete self;
00656 }
00657
00658 //////////////////////
00659 //// Functions
00660 //////////////////////
00661 static PyObject * instantiate(PyObject * self, PyObject *argtuple) {
00662 assert(PyTuple_Check(argtuple));
00663 if (4 != PyTuple_Size(argtuple)){
00664 PyErr_Format(PyExc_TypeError, "Wrong number of arguments, expected 4, got %i", (int)PyTuple_Size(argtuple));
00665 return NULL;
00666 }
00667 __struct_compiled_op_m7e2defd3cf256d1cfbc2cdcfd979dff0* struct_ptr = new __struct_compiled_op_m7e2defd3cf256d1cfbc2cdcfd979dff0();
00668 if (struct_ptr->init( PyTuple_GET_ITEM(argtuple, 0),PyTuple_GET_ITEM(argtuple, 1),PyTuple_GET_ITEM(argtuple, 2),PyTuple_GET_ITEM(argtuple, 3) ) != 0) {
00669 delete struct_ptr;
00670 return NULL;
00671 }
00672 PyObject* thunk = PyCapsule_New((void*)(&__struct_compiled_op_m7e2defd3cf256d1cfbc2cdcfd979dff0_executor), NULL, __struct_compiled_op_m7e2defd3cf256d1cfbc2cdcfd979dff0_destructor);
00673 if (thunk != NULL && PyCapsule_SetContext(thunk, struct_ptr) != 0) {
00674 PyErr_Clear();
00675 Py_DECREF(thunk);
00676 thunk = NULL;
00677 }
00678
00679 return thunk; }
00680
00681 //////////////////////
00682 //// Module init
00683 //////////////////////
00684 static PyMethodDef MyMethods[] = {
00685 {"instantiate", instantiate, METH_VARARGS, "undocumented"} ,
00686 {NULL, NULL, 0, NULL}
00687 };
00688 static struct PyModuleDef moduledef = {
00689 PyModuleDef_HEAD_INIT,
00690 "m7e2defd3cf256d1cfbc2cdcfd979dff0",
00691 NULL,
00692 -1,
00693 MyMethods,
00694 };
00695
00696 PyMODINIT_FUNC PyInit_m7e2defd3cf256d1cfbc2cdcfd979dff0(void) {
00697 import_array();
00698 PyObject *m = PyModule_Create(&moduledef);
00699 return m;
00700 }
00701
===============================
Problem occurred during compilation with the command line below:
/anaconda/envs/flow-rllab/bin/clang++ -dynamiclib -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable -Wno-write-strings -march=skylake -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -fPIC -undefined dynamic_lookup -I/anaconda/envs/flow-rllab/lib/python3.5/site-packages/numpy/core/include -I/anaconda/envs/flow-rllab/include/python3.5m -I/anaconda/envs/flow-rllab/lib/python3.5/site-packages/theano/gof -fvisibility=hidden -o /Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/m7e2defd3cf256d1cfbc2cdcfd979dff0.so /Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp -L/anaconda/envs/flow-rllab/lib
/Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp:470:27: error: non-constant-expression cannot be narrowed from type 'npy_intp' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]
int init_totals[2] = {V3_n0, V3_n1};
^~~~~
/Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp:470:27: note: insert an explicit cast to silence this issue
int init_totals[2] = {V3_n0, V3_n1};
^~~~~
static_cast<int>( )
/Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp:470:34: error: non-constant-expression cannot be narrowed from type 'npy_intp' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]
int init_totals[2] = {V3_n0, V3_n1};
^~~~~
/Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp:470:34: note: insert an explicit cast to silence this issue
int init_totals[2] = {V3_n0, V3_n1};
^~~~~
static_cast<int>( )
/Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp:482:9: error: non-constant-expression cannot be narrowed from type 'ssize_t' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]
V3_stride0, V3_stride1,
^~~~~~~~~~
/Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp:482:9: note: insert an explicit cast to silence this issue
V3_stride0, V3_stride1,
^~~~~~~~~~
static_cast<int>( )
/Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp:482:21: error: non-constant-expression cannot be narrowed from type 'ssize_t' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]
V3_stride0, V3_stride1,
^~~~~~~~~~
/Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp:482:21: note: insert an explicit cast to silence this issue
V3_stride0, V3_stride1,
^~~~~~~~~~
static_cast<int>( )
/Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp:483:4: error: non-constant-expression cannot be narrowed from type 'ssize_t' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]
0, V5_stride1
^~~~~~~~~~
/Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp:483:4: note: insert an explicit cast to silence this issue
0, V5_stride1
^~~~~~~~~~
static_cast<int>( )
5 errors generated.
Traceback (most recent call last):
File "/Users/lucasfischer/rllab-multiagent/scripts/run_experiment_lite.py", line 137, in <module>
run_experiment(sys.argv)
File "/Users/lucasfischer/rllab-multiagent/scripts/run_experiment_lite.py", line 121, in run_experiment
method_call(variant_data)
File "examples/rllab/figure_eight.py", line 62, in run_task
hidden_sizes=(16, 16)
File "/Users/lucasfischer/rllab-multiagent/rllab/policies/gaussian_mlp_policy.py", line 115, in __init__
outputs=[mean_var, log_std_var],
File "/Users/lucasfischer/rllab-multiagent/rllab/misc/ext.py", line 144, in compile_function
**kwargs
File "/anaconda/envs/flow-rllab/lib/python3.5/site-packages/theano/compile/function.py", line 322, in function
output_keys=output_keys)
File "/anaconda/envs/flow-rllab/lib/python3.5/site-packages/theano/compile/pfunc.py", line 480, in pfunc
output_keys=output_keys)
File "/anaconda/envs/flow-rllab/lib/python3.5/site-packages/theano/compile/function_module.py", line 1784, in orig_function
defaults)
File "/anaconda/envs/flow-rllab/lib/python3.5/site-packages/theano/compile/function_module.py", line 1648, in create
input_storage=input_storage_lists, storage_map=storage_map)
File "/anaconda/envs/flow-rllab/lib/python3.5/site-packages/theano/gof/link.py", line 693, in make_thunk
storage_map=storage_map)[:3]
File "/anaconda/envs/flow-rllab/lib/python3.5/site-packages/theano/gof/vm.py", line 1034, in make_all
no_recycling))
File "/anaconda/envs/flow-rllab/lib/python3.5/site-packages/theano/gof/op.py", line 969, in make_thunk
no_recycling)
File "/anaconda/envs/flow-rllab/lib/python3.5/site-packages/theano/gof/op.py", line 872, in make_c_thunk
output_storage=node_output_storage)
File "/anaconda/envs/flow-rllab/lib/python3.5/site-packages/theano/gof/cc.py", line 1200, in make_thunk
keep_lock=keep_lock)
File "/anaconda/envs/flow-rllab/lib/python3.5/site-packages/theano/gof/cc.py", line 1143, in __compile__
keep_lock=keep_lock)
File "/anaconda/envs/flow-rllab/lib/python3.5/site-packages/theano/gof/cc.py", line 1591, in cthunk_factory
key=key, lnk=self, keep_lock=keep_lock)
File "/anaconda/envs/flow-rllab/lib/python3.5/site-packages/theano/gof/cmodule.py", line 1145, in module_from_key
module = lnk.compile_cmodule(location)
File "/anaconda/envs/flow-rllab/lib/python3.5/site-packages/theano/gof/cc.py", line 1502, in compile_cmodule
preargs=preargs)
File "/anaconda/envs/flow-rllab/lib/python3.5/site-packages/theano/gof/cmodule.py", line 2282, in compile_str
(status, compile_stderr.replace('\n', '. ')))
Exception: ('The following error happened while compiling the node', Elemwise{Composite{tanh((i0 + i1))}}[(0, 0)](Dot22.0, InplaceDimShuffle{x,0}.0), '\n', "Compilation failed (return status=1): /Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp:470:27: error: non-constant-expression cannot be narrowed from type 'npy_intp' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]. int init_totals[2] = {V3_n0, V3_n1};. ^~~~~. /Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp:470:27: note: insert an explicit cast to silence this issue. int init_totals[2] = {V3_n0, V3_n1};. ^~~~~. static_cast<int>( ). /Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp:470:34: error: non-constant-expression cannot be narrowed from type 'npy_intp' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]. int init_totals[2] = {V3_n0, V3_n1};. ^~~~~. /Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp:470:34: note: insert an explicit cast to silence this issue. int init_totals[2] = {V3_n0, V3_n1};. ^~~~~. static_cast<int>( ). /Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp:482:9: error: non-constant-expression cannot be narrowed from type 'ssize_t' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]. V3_stride0, V3_stride1, . ^~~~~~~~~~. /Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp:482:9: note: insert an explicit cast to silence this issue. V3_stride0, V3_stride1, . ^~~~~~~~~~. static_cast<int>( ). /Users/lucasfischer/.theano/copiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp:482:21: error: non-constant-expression cannot be narrowed from type 'ssize_t' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]. V3_stride0, V3_stride1, . ^~~~~~~~~~. /Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp:482:21: note: insert an explicit cast to silence this issue. V3_stride0, V3_stride1, . ^~~~~~~~~~. static_cast<int>( ). /Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp:483:4: error: non-constant-expression cannot be narrowed from type 'ssize_t' (aka 'long') to 'int' in initializer list [-Wc++11-narrowing]. 0, V5_stride1. ^~~~~~~~~~. /Users/lucasfischer/.theano/compiledir_Darwin-17.7.0-x86_64-i386-64bit-i386-3.5.2-64/tmpwjk1adym/mod.cpp:483:4: note: insert an explicit cast to silence this issue. 0, V5_stride1. ^~~~~~~~~~. static_cast<int>( ). 5 errors generated.. ", '[Elemwise{Composite{tanh((i0 + i1))}}[(0, 0)](<TensorType(float64, matrix)>, <TensorType(float64, row)>)]')```
Hi,
I saw that Ray was just updated. In my docker, I tried to pull the you repo but i encountered
```Automatic Merge failed : fix conflicts and then commit the result
`
I then tried to build it again from scratch, I have ray installed but the module ray.rllib.ppo isn't found when I run 'python examples/rllib/figure_eight.py'
Any change in the installation process ?
Thanks
In order to ensure that our documentation doesn't degrade with time, we should consider adding tests to ensure compliance with standards such as PEP-257.
One really good tool is pydocstyle
. To install, run:
pip install pydocstyle
Then to use while testing for numpy-style documentation (which is what we are following), run:
pydocstyle --convention=numpy
Our documentation currently needs a lot of work to get it complying with these standards, but once it is up to date, we should add it to the travis tests, as we did with flake8
for pep8
Introduction page should be more descriptive and include the following:
Other suggestions?
I think it would be nice if our README.md
files cover more content for whoever might want a better idea of what the content of flow or the benchmarks are.
This is a very good example: https://github.com/AtsushiSakai/PythonRobotics
README files to modify:
Currently, the default name for an inflow is "flow_%d". I think we should allow custom naming schemes.
A few fast tweaks to the website homepage:
Currently visualizer_rllib defaults to assuming you're using PPO, but there's no particular reason for this choice and it actually winds up confusing users (and me!). By not specifying a default, users are made aware that they need to specify the algorithm that they use.
Tensorflow does not yet support python 3.7 because async is a reserved keyword (tensorflow/tensorflow#20690) so we should be clear and restrict the version of python
Currently the instructions for how to use sumo-web3d are contained in https://github.com/flow-project/sumo-web3d README but we should incorporate it into our normal instructions so that everyone can use it. It also depends on issue #78
In https://github.com/flow-project/flow/blob/master/docs/source/flow_setup.rst
we are installing two environment, one is from (https://github.com/cathywu/rllab-multiagent.git) and the other one from flow (https://github.com/flow-project/flow.git).
I installed both those environement and both seems to make rllab work.
Is there any difference between those two ?
Thanks
The AWS image we use for EC2 is currently private; it would be nice to develop one that researchers could use so they don't have to set it up. This image would have to come with Flow, Sumo, and Rllib.
We have many basic networks for flow; rings, bottlenecks, grids, etc. A useful tool would be one that let you construct new networks by combining these networks.
Any idea why this is happening?
Warning: At actuated tlLogic 'center0', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center1', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center2', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center3', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center4', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center5', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center6', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center7', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center8', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center9', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center10', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center11', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center12', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center13', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center14', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center15', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center16', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center17', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center18', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center19', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center20', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center21', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center22', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center23', minDur 3.00 is too short to short for detector gap of 28.00m.
Warning: At actuated tlLogic 'center24', minDur 3.00 is too short to short for detector gap of 28.00m.
See "Calibration and Evaluation of Car Following Models Using Real-World Driving" by Pourabdollah et al. (ITSC17), includes IDM.
It's sort of confusing that examples is outside the flow folder but benchmarks is inside? Maybe we move both inside or both outside? @AboudyKreidieh
Currently we do not have a tutorial for running experiments on EC2 with rllib. This would be helpful for researchers who want to do this.
Currently setup_osx doesn't show output when it's doing the svn checkout which makes it look like the script has hung
No point in having both afaik, let's combine these?
We need this if people are going to have a shot at understanding our codebase without constantly asking us every time they explore something new.
Example:
class RLController(BaseController):
"""Instantiates an RL Controller.
Vehicle with this class specified will be stored in the list of the RL IDs
in the Vehicles class.
Usage:
>>> from flow.core.vehicles import Vehicles
>>> vehicles = Vehicles()
>>> vehicles.add(acceleration_controller=(RLController, {}))
In order to collect the list of all RL vehicles in the next, run:
>>> rl_ids = vehicles.get_rl_ids()
Attributes
----------
veh_id: str
Vehicle ID for SUMO identification
fail_safe: str, optional
type of flow-imposed failsafe the vehicle should posses, defaults
to no failsafe (None)
"""
We are currently on a fork of rllib 0.4.0. This is blocked by needing ARS to be incorporated into RLlib 0.5.0
Currently Sumo has released libsumo, which they are asserting will make everything faster. We should implement this and see if we get a speedboost.
This could improve the accessibility of the software. Sometimes users do not have python3 installed or unconsciously installed everything with python2, e,g., when sudo python setup.py develop
where the default sudo python
is python2. This compatibility support would make the software still runnable even when users deviate from the recommended installation procedure.
We need a tutorial for each of the benchmarks describing
I cannot preview several of the tutorials on github (screenshots of error below) -- anyone else have this problem?
Links for convenience:
https://github.com/flow-project/flow/blob/master/tutorials/tutorial02_rllib.ipynb
https://github.com/flow-project/flow/blob/master/tutorials/tutorial03_rllab.ipynb
We need to test that things pass on OSX as well.
Look at ray's travis.yml for an example of how to do so.
In general we should minimize usage of primitive data structures to hold complex info (e.g. routes should be a dict of lists, specify_edge_starts is a list of tuples, etc). Classes are an easier representation.
Currently we do not have regression tests for the Flow-benchmarks-v0. These would take a long time to run, but could be done once a week and the outputs checked.
In docs/source/flow_setup.rst, some things are unclear:
pip install ray
, when in fact we just want them to install the dependencies.It might be handy to support abstract backend calling in Flow in a way similar to what Keras backend does.
An hypothetical API could be as follows:
(in bash)
export FLOW_BACKEND = "libsumo"
(in python)
from flow import backend as K
K.addFull(...)
K.setSpeed(...)
...
K.step()
...
K.getPosition(...)
K.getAcceleration(...)
SUMO wheels install
(flow) cathywu:~/flow-public$ python examples/rllab/stabilizing_the_ring.py
/Users/cathywu/anaconda/envs/flow/lib/python3.5/site-packages/theano/tensor/signal/downsample.py:6: UserWarning: downsample module has been moved to the theano.tensor.signal.pool module.
"downsample module has been moved to the theano.tensor.signal.pool module.")
Traceback (most recent call last):
File "examples/rllab/stabilizing_the_ring.py", line 9, in <module>
from flow.scenarios.loop.gen import CircleGenerator
File "/Users/cathywu/NotDropbox/flow-public/flow/scenarios/__init__.py", line 4, in <module>
from flow.scenarios.base_scenario import Scenario
File "/Users/cathywu/NotDropbox/flow-public/flow/scenarios/base_scenario.py", line 16, in <module>
from flow.core.traffic_lights import TrafficLights
File "/Users/cathywu/NotDropbox/flow-public/flow/core/traffic_lights.py", line 3, in <module>
import traci.constants as tc
ImportError: No module named 'traci'
https://github.com/sidewalklabs/sumo-web3d/
is an incredible visualization tool that we should figure out a pipeline for using,
They seem to have disappeared from our website.
I mean both the following:
We have something basic in the docs/ folder, and I think @nskh setup something on berkeleyflow. One thing he pointed out, that I sort of agree on, is that it may be better to have it on readthedocs instead of the tutorials folder, since there isn't really any code to run. Anything to include @nskh (or anyone else)?
When you import logger in the rllab examples you get an ImportError. It doesn't cause anything to fail, but it's confusing to users.
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.