GithubHelp home page GithubHelp logo

coxlab / prednet Goto Github PK

View Code? Open in Web Editor NEW
758.0 39.0 259.0 32.32 MB

Code and models accompanying "Deep Predictive Coding Networks for Video Prediction and Unsupervised Learning"

Home Page: https://arxiv.org/abs/1605.08104

License: MIT License

Python 98.67% Shell 1.33%

prednet's Introduction

prednet

Code and models accompanying Deep Predictive Coding Networks for Video Prediction and Unsupervised Learning by Bill Lotter, Gabriel Kreiman, and David Cox.

The PredNet is a deep recurrent convolutional neural network that is inspired by the neuroscience concept of predictive coding (Rao and Ballard, 1999; Friston, 2005). Check out example prediction videos here.

The architecture is implemented as a custom layer1 in Keras. Code and model data is compatible with Keras 2.0 and Python 2.7 and 3.6. The latest version has been tested on Keras 2.2.4 with Tensorflow 1.6. For previous versions of the code compatible with Keras 1.2.1, use fbcdc18. To convert old PredNet model files and weights for Keras 2.0 compatibility, see convert_model_to_keras2 in keras_utils.py.

KITTI Demo

Code is included for training the PredNet on the raw KITTI dataset. We include code for downloading and processing the data, as well as training and evaluating the model. The preprocessed data and can also be downloaded directly using download_data.sh and the trained weights by running download_models.sh. The model download will include the original weights trained for t+1 prediction, the fine-tuned weights trained to extrapolate predictions for multiple timesteps, and the "Lall" weights trained with an 0.1 loss weight on upper layers (see paper for details).

Steps

  1. Download/process data

    python process_kitti.py

    This will scrape the KITTI website to download the raw data from the city, residential, and road categories (~165 GB) and then process the images (cropping, downsampling). Alternatively, the processed data (~3 GB) can be directly downloaded by executing download_data.sh

  2. Train model

    python kitti_train.py

    This will train a PredNet model for t+1 prediction. See Keras FAQ on how to run using a GPU. To download pre-trained weights, run download_models.sh

  3. Evaluate model

    python kitti_evaluate.py

    This will output the mean-squared error for predictions as well as make plots comparing predictions to ground-truth.

Feature Extraction

Extracting the intermediate features for a given layer in the PredNet can be done using the appropriate output_mode argument. For example, to extract the hidden state of the LSTM (the "Representation" units) in the lowest layer, use output_mode = 'R0'. More details can be found in the PredNet docstring.

Multi-Step Prediction

The PredNet argument extrap_start_time can be used to force multi-step prediction. Starting at this time step, the prediction from the previous time step will be treated as the actual input. For example, if the model is run on a sequence of 15 timesteps with extrap_start_time = 10, the last output will correspond to a t+5 prediction. In the paper, we train in this setting starting from the original t+1 trained weights (see kitti_extrap_finetune.py), and the resulting fine-tuned weights are included in download_models.sh. Note that when training with extrapolation, the "errors" are no longer tied to ground truth, so the loss should be calculated on the pixel predictions themselves. This can be done by using output_mode = 'prediction', as illustrated in kitti_extrap_finetune.py.

Additional Notes

When training on a new dataset, the image size has to be divisible by 2^(nb of layers - 1) because of the cyclical 2x2 max-pooling and upsampling operations.


1 Note on implementation: PredNet inherits from the Recurrent layer class, i.e. it has an internal state and a step function. Given the top-down then bottom-up update sequence, it must currently be implemented in Keras as essentially a 'super' layer where all layers in the PredNet are in one PredNet 'layer'. This is less than ideal, but it seems like the most efficient way as of now. We welcome suggestions if anyone thinks of a better implementation.

prednet's People

Contributors

berkgercek avatar bill-lotter avatar crizcraig avatar mmbannert avatar qinenergy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

prednet's Issues

Prediction_results

Hi,
I used your code with only two stack layers on some sample videos.
However, from the results it seems that the prediction comes with one frame delay.
Does it mean that there is a bug in the code or I did not understand the network correctly?
I used the below parameters:

Model parameters

nt = 10
n_channels, im_height, im_width = (3, 128, 160)
input_shape = (n_channels, im_height, im_width) if K.image_dim_ordering() == 'th' else (im_height, im_width, n_channels)
stack_sizes = (n_channels, 32)
R_stack_sizes = stack_sizes
A_filt_sizes = (3,)
Ahat_filt_sizes = (3, 3)
R_filt_sizes = (3, 3)
layer_loss_weights = np.array([1., 0.])
layer_loss_weights = np.expand_dims(layer_loss_weights, 1)
time_loss_weights = 1./ (nt - 1) * np.ones((nt,1))
time_loss_weights[0] = 0

Sample prediction results:
plot_2

plot_68

Any suggestion. Thanks a lot.

kitti_train.py cannot initialize weights from downloaded data

Hi, I am currently trying to run your model using Python 2.7 and Theano==0.9.0 (using a GPU with pygpu==0.6.2). I am skipping the first step (by executing download_data.sh) and going straight to training (python kitti_train.py).

I initially tried using keras==2.0.2, but saw this error:

Traceback (most recent call last):
  File "kitti_train.py", line 59, in <module>
    errors = prednet(inputs)  # errors will be (batch_size, nt, nb_layers)
  File "/home/arvoelke/.virtualenvs/CTN/local/lib/python2.7/site-packages/keras/layers/recurrent.py", line 252, in __call__
    return super(Recurrent, self).__call__(inputs, **kwargs)
  File "/home/arvoelke/.virtualenvs/CTN/local/lib/python2.7/site-packages/keras/engine/topology.py", line 528, in __call__
    self.build(input_shapes[0])
  File "/home/arvoelke/prednet/prednet.py", line 216, in build
    if self.initial_weights is not None:
AttributeError: 'PredNet' object has no attribute 'initial_weights'

Then I noticed you suggest keras==1.2.0, so I downgraded, and retried, but saw a different error:

python kitti_train.py
Using Theano backend.
Can not use cuDNN on context None: Device not supported
Mapped name None to device cuda: Tesla C2075 (0000:02:00.0)
Traceback (most recent call last):
  File "kitti_train.py", line 60, in <module>
    errors_by_time = TimeDistributed(Dense(1, weights=[layer_loss_weights, np.zeros(1)], trainable=False), trainable=False)(errors)  # calculate weighted error by layer
  File "/home/arvoelke/.virtualenvs/CTN/local/lib/python2.7/site-packages/keras/engine/topology.py", line 543, in __call__
    self.build(input_shapes[0])
  File "/home/arvoelke/.virtualenvs/CTN/local/lib/python2.7/site-packages/keras/layers/wrappers.py", line 98, in build
    self.layer.build(child_input_shape)
  File "/home/arvoelke/.virtualenvs/CTN/local/lib/python2.7/site-packages/keras/layers/core.py", line 763, in build
    self.set_weights(self.initial_weights)
  File "/home/arvoelke/.virtualenvs/CTN/local/lib/python2.7/site-packages/keras/engine/topology.py", line 966, in set_weights
    str(weights)[:50] + '...')
ValueError: You called `set_weights(weights)` on layer "dense_1" with a  weight list of length 2, but the layer was expecting 0 weights. Provided weights: [array([[ 1.],
       [ 0.],
       [ 0.],
       ...

Any tips for things I could try? Thanks, Aaron

Multiple Timesteps Prediction

Can you please provide the code for multiple timesteps prediction as well as for the finetuned multiple timesteps prediction?

code for steering angle

@bill-lotter if you could provide the code for steering angle analysis (spatially pooling lower layers and fitting a fully connected readout was fit using MSE) it would be really helpful in my project and I would be really thankful to you. Please let me know if it's possible and thanks?

input dimensions don't match

Hi
I'm trying to run kitti_evaluate using Keras (1.1.1) with Theano (0.9.0.dev4) on CPU but catch an error

ValueError: all the input array dimensions except for the concatenation axis must match exactly

Full log and stacktrace in attachement
prednet.txt

Can you help me to run it?

problem in training

I'm using Ubuntu 14.04, cuda 7.5, cuDNN5 and tensorflow r0.11
When I try to run kitti_train.py it shows
2016-12-04 7 31 49
It seems a bug?

Enquiry about the performance of PredNet in Comma.ai dataset

Dear lotter,
I am HOU Yuenan, a PhD student from the Chinese University of Hong Kong. I am interested in your paper "Deep predictive coding networks for video prediction and unsupervised learning" and I wish to clarify a few points with you. Your help is much appreciated.
(1) As far as I know, there is no official train/test partitions for the Comma.ai dataset. I wonder how the data is divided in your paper since a random continuous chunk of 11 video clips is chosen as the testing set in your setting. I wish to compare fairly with your approach on the same train/test partitions.
(2) Do the following two figures depict the performance of PredNet in your selected testing set? It is quite impressive since you use only a small part of training set (25k labeled training samples) and achieve so good results.
Looking forward to your reply!
Regards,
Yuenan
66
67

Input array dimensions not matching

I am trying to run PredNet using the pre-processed data and the pretrained model, nothing modified in the code.
(Unrelated: It would be nice to indicate somewhere that your model doesn't support Python 3! Or maybe it was written and I missed it?)

For

python kitti_evaluate.py

I get the following error:

Using Theano backend.
Traceback (most recent call last):
  File "kitti_evaluate.py", line 52, in <module>
    X_hat = test_model.predict(X_test, batch_size)
  File "//anaconda/lib/python2.7/site-packages/keras/engine/training.py", line 1197, in predict
    batch_size=batch_size, verbose=verbose)
  File "//anaconda/lib/python2.7/site-packages/keras/engine/training.py", line 896, in _predict_loop
    batch_outs = f(ins_batch)
  File "//anaconda/lib/python2.7/site-packages/keras/backend/theano_backend.py", line 792, in __call__
    return self.function(*inputs)
  File "//anaconda/lib/python2.7/site-packages/theano/compile/function_module.py", line 871, in __call__
    storage_map=getattr(self.fn, 'storage_map', None))
  File "//anaconda/lib/python2.7/site-packages/theano/gof/link.py", line 314, in raise_with_op
    reraise(exc_type, exc_value, exc_trace)
  File "//anaconda/lib/python2.7/site-packages/theano/compile/function_module.py", line 859, in __call__
    outputs = self.fn()
  File "//anaconda/lib/python2.7/site-packages/theano/scan_module/scan_op.py", line 951, in rval
    r = p(n, [x[0] for x in i], o)
  File "//anaconda/lib/python2.7/site-packages/theano/scan_module/scan_op.py", line 940, in <lambda>
    self, node)
  File "theano/scan_module/scan_perform.pyx", line 405, in theano.scan_module.scan_perform.perform (/Users/lana/.theano/compiledir_Darwin-15.6.0-x86_64-i386-64bit-i386-2.7.10-64/scan_perform/mod.cpp:4316)
  File "//anaconda/lib/python2.7/site-packages/theano/gof/link.py", line 314, in raise_with_op
    reraise(exc_type, exc_value, exc_trace)
  File "theano/scan_module/scan_perform.pyx", line 397, in theano.scan_module.scan_perform.perform (/Users/lana/.theano/compiledir_Darwin-15.6.0-x86_64-i386-64bit-i386-2.7.10-64/scan_perform/mod.cpp:4193)
ValueError: all the input array dimensions except for the concatenation axis must match exactly
Apply node that caused the error: Join(TensorConstant{1}, <TensorType(float32, 4D)>, <TensorType(float32, 4D)>, Reshape{4}.0)
Toposort index: 61
Inputs types: [TensorType(int8, scalar), TensorType(float32, 4D), TensorType(float32, 4D), TensorType(float32, 4D)]
Inputs shapes: [(), (10, 96, 32, 40), (10, 192, 32, 40), (10, 384, 32, 20)]
Inputs strides: [(), (491520, 5120, 160, 4), (983040, 5120, 160, 4), (983040, 2560, 80, 4)]
Inputs values: [array(1, dtype=int8), 'not shown', 'not shown', 'not shown']
Outputs clients: [[CorrMM{half, (1, 1)}(Join.0, Subtensor{::, ::, ::int64, ::int64}.0), CorrMM{half, (1, 1)}(Join.0, Subtensor{::, ::, ::int64, ::int64}.0), CorrMM{half, (1, 1)}(Join.0, Subtensor{::, ::, ::int64, ::int64}.0), CorrMM{half, (1, 1)}(Join.0, Subtensor{::, ::, ::int64, ::int64}.0)]]

Custom Output Shape

Hello,

I was wondering if there's an easy way to change prednet output shape to be different than the input in the model itself? I am trying to input 128x128x3 images and output 128x128x1 images. I changed the appropriate data_utils functions, but not sure what the best way to do it within prednet.py is?

Thanks!
Masha

Shapes (128, 160) and (64, 80) are not compatible

After downloading the models, when I run kitti_evaluate.py, I get the following error.
File "kitti_evaluate.py", line 36, in
train_model = model_from_json(json_string, custom_objects = {'PredNet': PredNet})
File "/usr/local/lib/python2.7/dist-packages/keras/models.py", line 197, in model_from_json
return layer_from_config(config, custom_objects=custom_objects)
File "/usr/local/lib/python2.7/dist-packages/keras/utils/layer_utils.py", line 36, in layer_from_config
return layer_class.from_config(config['config'])
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 2375, in from_config
process_layer(layer_data)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 2370, in process_layer
layer(input_tensors[0])
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 514, in call
self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 572, in add_inbound_node
Node.create_node(self, inbound_layers, node_indices, tensor_indices)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 149, in create_node
output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0]))
File "/usr/local/lib/python2.7/dist-packages/keras/layers/recurrent.py", line 215, in call
input_length=input_shape[1])
File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 1179, in rnn
state = tf.concat(1, states)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 697, in concat
name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_array_ops.py", line 414, in _concat
values=values, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 703, in apply_op
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2319, in create_op
set_shapes_for_outputs(ret)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1711, in set_shapes_for_outputs
shapes = shape_func(op)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 757, in _ConcatShape
concat_dim + 1:].merge_with(value_shape[concat_dim + 1:])
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_shape.py", line 570, in merge_with
(self, other))
ValueError: Shapes (128, 160) and (64, 80) are not compatible

Can you help resolve this?
Can you help resolve

keras 2.0.1

Hi,
I adapted your code to my needs and it was working perfectly until I installed the latest keras version (2.0.1). Did some of you tried to run prednet with keras 2.0? The error I am getting is the following (even if I use 'th' or 'tf'). Any suggestion to fix that will be very appreciated. Thanks a lot.


/usr/local/lib/python2.7/dist-packages/keras/legacy/interfaces.py:86: UserWarning: Update your Conv2D call to the Keras 2 API: Conv2D(1, (3, 3), padding="same", activation=<function ..., data_format="channels_last")
'call to the Keras 2 API: ' + signature) /usr/local/lib/python2.7/dist-packages/keras/legacy/interfaces.py:86: UserWarning: Update yourConv2Dcall to the Keras 2 API:Conv2D(1, (3, 3), padding="same", activation="relu", data_format="channels_last") ' call to the Keras 2 API: ' + signature)
/usr/local/lib/python2.7/dist-packages/keras/legacy/interfaces.py:86: UserWarning: Update your Conv2D call to the Keras 2 API: Conv2D(48, (3, 3), padding="same", activation=<function ..., data_format="channels_last")
'call to the Keras 2 API: ' + signature) /usr/local/lib/python2.7/dist-packages/keras/legacy/interfaces.py:86: UserWarning: Update yourConv2Dcall to the Keras 2 API:Conv2D(96, (3, 3), padding="same", activation=<function ..., data_format="channels_last") ' call to the Keras 2 API: ' + signature)
/usr/local/lib/python2.7/dist-packages/keras/legacy/interfaces.py:86: UserWarning: Update your Conv2D call to the Keras 2 API: Conv2D(192, (3, 3), padding="same", activation=<function ..., data_format="channels_last")
'` call to the Keras 2 API: ' + signature)
Traceback (most recent call last):
File "predictSpatioTemporal.py", line 267, in
cache_dir=cache_dir)
File "predictSpatioTemporal.py", line 173, in predictSpatioTemporal
train_prednet_model()
File "code/chalearn_train.py", line 71, in train_prednet_model
errors = prednet(inputs) # errors will be (batch_size, nt, nb_layers)
File "/usr/local/lib/python2.7/dist-packages/keras/layers/recurrent.py", line 252, in call
return super(Recurrent, self).call(inputs, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 528, in call
self.build(input_shapes[0])
File "code/prednet.py", line 196, in build
if self.initial_weights is not None:
AttributeError: 'PredNet' object has no attribute 'initial_weights'

Dimension mismatch in concatenation

I'm trying to use this code on a single-channel set of images, and believe I have inputted all of the dimensions/filter sizes correctly according to the kitti_train.py file. However, I get this error every time I run it.

Traceback (most recent call last):
File "/Users/jordanharrod/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/common_shapes.py", line 671, in _call_cpp_shape_fn_impl
input_tensors_as_shapes, status)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/contextlib.py", line 89, in exit
next(self.gen)
File "/Users/jordanharrod/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Dimension 0 in both shapes must be equal, but are 45 and 44 for 'pred_net_1/concat_2' (op: 'ConcatV2') with input shapes: [?,64,45,20], [?,128,45,20], [?,128,44,20], [] and with computed input tensors: input[3] = <1>.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "MR_train.py", line 169, in
errors = prednet(inputs) # errors will be (batch_size, nt, nb_layers)
File "/Users/jordanharrod/tensorflow/lib/python3.6/site-packages/keras/layers/recurrent.py", line 262, in call
return super(Recurrent, self).call(inputs, **kwargs)
File "/Users/jordanharrod/tensorflow/lib/python3.6/site-packages/keras/engine/topology.py", line 596, in call
output = self.call(inputs, **kwargs)
File "/Users/jordanharrod/tensorflow/lib/python3.6/site-packages/keras/layers/recurrent.py", line 341, in call
input_length=input_shape[1])
File "/Users/jordanharrod/tensorflow/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2457, in rnn
outputs, _ = step_function(inputs[0], initial_states + constants)
File "/Users/jordanharrod/Dropbox/Jordan-project/Jordan-AmgenSSRP2017/prednet.py", line 241, in step
inputs = K.concatenate(inputs, axis=self.channel_axis)
File "/Users/jordanharrod/tensorflow/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 1723, in concatenate
return tf.concat([to_dense(x) for x in tensors], axis)
File "/Users/jordanharrod/tensorflow/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 1034, in concat
name=name)
File "/Users/jordanharrod/tensorflow/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 519, in _concat_v2
name=name)
File "/Users/jordanharrod/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 768, in apply_op
op_def=op_def)
File "/Users/jordanharrod/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2338, in create_op
set_shapes_for_outputs(ret)
File "/Users/jordanharrod/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1719, in set_shapes_for_outputs
shapes = shape_func(op)
File "/Users/jordanharrod/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1669, in call_with_requiring
return call_cpp_shape_fn(op, require_shape_fn=True)
File "/Users/jordanharrod/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/common_shapes.py", line 610, in call_cpp_shape_fn
debug_python_shape_fn, require_shape_fn)
File "/Users/jordanharrod/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/common_shapes.py", line 676, in _call_cpp_shape_fn_impl
raise ValueError(err.message)
ValueError: Dimension 0 in both shapes must be equal, but are 45 and 44 for 'pred_net_1/concat_2' (op: 'ConcatV2') with input shapes: [?,64,45,20], [?,128,45,20], [?,128,44,20], [] and with computed input tensors: input[3] = <1>.

I have tried with Python 2.7 and Python 3 with the same results, and am using a TF backend. I've also varied the stack sizes, but the dimensions are always off by 1 for that third matrix.
Below are my PredNet inputs:

nt = 18
n_channels, im_height, im_width = (1, 180, 80)
input_shape = (n_channels, im_height, im_width)
stack_sizes = (n_channels, 32, 64, 128, 256)
R_stack_sizes = stack_sizes
A_filt_sizes = (3, 3, 3, 3)
Ahat_filt_sizes = (3, 3, 3,3, 3)
R_filt_sizes = (3, 3, 3, 3, 3)
layer_loss_weights = np.array([1., 0., 0., 0., 0.])
layer_loss_weights = np.expand_dims(layer_loss_weights, 1)
time_loss_weights = 1./ (nt - 1) * np.ones((nt,1))
time_loss_weights[0] = 0

Can someone help me figure out what this issue is?

What is the Copy last frame?

Hello,
First of all, thank you for publishing great study.

The question is that What is the “Copy-Last-Frame”?
I don’t know exactly how I can use this approach as a baseline.
Could you tell me about the “Copy-Last-Frame”?

NotImplementedError

coxlab_prednet$ python kitti_train.py

Using TensorFlow backend.
2019-01-15 16:22:57.611344: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: FMA
/usr/local/lib/python2.7/dist-packages/hickle/hickle.py:518: UserWarning: Hickle file appears to be old version (v2), attempting legacy loading...
warnings.warn("Hickle file appears to be old version (v2), attempting "
Epoch 1/150
Traceback (most recent call last):
File "kitti_train.py", line 76, in
validation_data=val_generator, validation_steps=N_seq_val / batch_size)
File "/usr/local/lib/python2.7/dist-packages/keras/legacy/interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/training.py", line 1418, in fit_generator
initial_epoch=initial_epoch)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/training_generator.py", line 181, in fit_generator
generator_output = next(output_generator)
File "/usr/local/lib/python2.7/dist-packages/keras/utils/data_utils.py", line 601, in get
six.reraise(*sys.exc_info())
File "/usr/local/lib/python2.7/dist-packages/keras/utils/data_utils.py", line 595, in get
inputs = self.queue.get(block=True).get()
File "/usr/lib/python2.7/multiprocessing/pool.py", line 558, in get
raise self._value
NotImplementedError
Exception TypeError: "'NoneType' object is not callable" in <Finalize object, dead> ignored
Exception TypeError: "'NoneType' object is not callable" in <Finalize object, dead> ignored

Error in training

I roll back to keras 1.0.7 but it doesn't work for this problem...

Epoch 1/150
Traceback (most recent call last):
File "kitti_train.py", line 75, in
validation_data=val_generator, nb_val_samples=N_seq_val)
File "/usr/local/lib/python2.7/dist-packages/Keras-1.0.7-py2.7.egg/keras/engine/training.py", line 1444, in fit_generator
class_weight=class_weight)
File "/usr/local/lib/python2.7/dist-packages/Keras-1.0.7-py2.7.egg/keras/engine/training.py", line 1216, in train_on_batch
check_batch_dim=True)
File "/usr/local/lib/python2.7/dist-packages/Keras-1.0.7-py2.7.egg/keras/engine/training.py", line 962, in _standardize_user_data
exception_prefix='model input')
File "/usr/local/lib/python2.7/dist-packages/Keras-1.0.7-py2.7.egg/keras/engine/training.py", line 108, in standardize_input_data
str(array.shape))
Exception: Error when checking model input: expected input_1 to have shape (None, 10, 3, 128, 160) but got array with shape (4, 10, 128, 160, 3)

PredNet on binary images

Hello,
I'm trying to use PredNet on a dataset with binary images (black/white).
In the training file I changed the number of channels to 1 instead of 3.
However, an error shows up when I try to train it.

File "t1_train.py", line 78, in <module> validation_data=val_generator, validation_steps=N_seq_val / batch_size)
...
...
raise TypeError(msg % (v1.type, v2.type, a1, b1, b2, a2)) TypeError: The broadcast pattern of the output of scan (TensorType(float32, 5D)) is inconsistent with the one provided inoutput_info(TensorType(float32, (False, False, False, True))). The output on axis 3 isFalse, but it is Trueon axis 4 inoutput_info. This can happen if one of the dimension is fixed to 1 in the input, while it is still variable in the output, or vice-verca. You have to make them consistent, e.g. using theano.tensor.{patternbroadcast,unbroadcast,addbroadcast}.

As far as I understand, one of the dimensions of the input and output doesn't match. I don't really find the way to modify the output dimensions of the network. How can I do to make it to modify the network and work with binary images?

Extending prednet

Hi,

I am currently trying to extend prednet by adding a few convolution layers beside ['i', 'f', 'c', 'o', 'a', 'ahat']. With tensorflow backend, I successfully train that model. However, when loading model (.json) and weights (.hdf5), I face a following errors:

ValueError: Layer #0 (named "prednet_1" in the current model) was found to correspond to layer prednet_1                                                                                                            
in the save file. However the new layer prednet_1 expects 46 weights, but the saved weights have 62 eleme                                                                                                           
nts.

It seems there is an incoherence between number of weights in model file (.json) and actual weights (.hdf5). Any idea how can I fix it ? Appreciate any thoughts.

I have uploaded the code and trained model here https://github.com/lengoanhcat/prednet_alstm. When expspace_evaluate_alstm.py is run, you can see the mentioned error.

Regards,

Cat Le

can not reduce model reduce

when i download your model, the Model MSE is 0.08421.
But when I run the kitti_train.py and use the trained weights, I get the Model MSE 0.018259
this is my results in the test set:
image
Is the model in download_models.sh using the kitti_train.py?

access intermediate errors

Hello!

I'm trying to extract the error values for each layer, in output mode 'error' only the mean errors are outputted, and this method: keras-team/keras#431 (comment) doesn't work for PredNet. Do you have any reccomendations for how I approach this?

Cheers!

License

Hi,

Thank you for releasing source code.
Do you have a plan to add license file ?

Best regards,
Akira

Cannot reproduce model results

After running all of the steps in the README.md verbatim, the prediction_scores.txt contains:

Model MSE: 0.201040
Previous Frame MSE: 0.021246

and all of the generated plots contain only two colours (pink and blue), for example, here are the first five:
plot_0
plot_3
plot_4
plot_5
plot_7

I am using Python 2.7 and Theano==0.9.0 (GPU with pygpu==0.6.2) and Keras==1.0.8 (it seems higher versions are incompatible [see #18]). I am not using cuDNN.

Multi-step prediction ValueError: loading weight file containing 1 layers into a model with 3 layers.

Hi everyone,
first of all huge thanks to @bill-lotter for providing this code! I'm training the PredNet on weather data and t+1 predictions work pretty well.
Unfortunately, I'm struggling with training/ evaluating the multi-step prediction network. Running python kitti_extrap_finetune.py seems to work.
When I try to evaluate my network, I always receive the following error message:

ValueError: You are trying to load a weight file containing 1 layers into a model with 3 layers.

My evaluation code looks very much like the one from @abe-
https://github.com/abe-/landscape-prediction/blob/master/prednet/evaluate.py
where batch_size = 10, nt = 15 and extrap = 10.

Interestingly I can manage to evaluate the pretrained model. What's interesting though is that when loading prednet_kitti_weights-extrapfinetuned.hdf5 the data_format is set to channels_first. In the t+1 setting it is channels_last.
Here one example from a map over Europe. If everything works, from frame 10 on it should only be extrapolations.
plot_79

multiple time prediction

i thick there is something wrong about multiple time prediction,. you say Starting at this time step, the prediction from the previous time step will be treated as the actual input, but in time t-1, you prediction is not the image in time t, but the image in time t-1, so how can you treat it the goundtruth in time t?

Longer Term Predictions

Do you have any advice as to how to get the network to make longer term predictions (e.g., 2 seconds at 10 Hz) without completely deteriorating by the end?

Thanks!

"old hickle version" error

Hi!
When running kitty_evaluate.py, I get this error:

  File "kitti_evaluate.py", line 50, in <module>
    test_generator = SequenceGenerator(test_file, test_sources, nt, sequence_start_mode='unique', data_format=data_format)
  File "...\prednet\data_utils.py", line 12, in __init__
    self.X = hkl.load(data_file)  # X will be like (n_images, nb_cols, nb_rows, nb_channels)
  File "...\virtual_envs\prednet_venv\lib\site-packages\hickle\hickle.py", line 523, in load
    raise RuntimeError("Cannot open file. This file was likely"
RuntimeError: Cannot open file. This file was likely created with Python 2 and an old hickle version.

I am using Python 3.6 because the readme said that version was supported. I'm going to try with 2.7 but I'm reporting this error in case you want to look into it

Clarification on the model output

I have read the paper and readme and also the code, but I am not still quite clear what the output of the network indicates. In the evaluation mode, the network receives 10 frames for each sample, and outputs 10 frames. Shouldn't it be just one frame since the aim of the network is to predict one frame (t+1 frame), in this case frame 11? Thanks!

sorted(self.conv_layers.keys())

Hi,

Is there any reason for sorting the convolutional layers alphabetically before building them?

I'm having some trouble adding custom layers and it would be great to know that this isn't a factor.

Thanks

raise ValueError("Dimension %d must be >= 0" % self._value) ValueError: Dimension must be >= 0

When I was trying to add a new layer to the lowest representation layer, I met this error. I was wondering why I got a negative output dimension after the process of flatening. Here is the source files:

import tensorflow as tf
from keras.models import load_model

from keras.models import model_from_json
import os
import numpy as np
np.random.seed(123)
from six.moves import cPickle

from keras import backend as K
from keras.models import Model
from keras.layers import Input, Dense, Flatten
from keras.layers import LSTM
from keras.layers import TimeDistributed
from keras.callbacks import LearningRateScheduler, ModelCheckpoint
from keras.optimizers import Adam

from prednet import PredNet
from data_utils import SequenceGenerator
from kitti_settings import *



nb_epoch = 150
batch_size = 4
samples_per_epoch = 500
N_seq_val = 100  # number of sequences to use for validation


nt=10

MODEL_DATA_DIR='./model_data/'
DATA_DIR='./hkl'

batch_size=10

train_file = os.path.join(DATA_DIR, 'X-Train.hkl')

train_sources = os.path.join(DATA_DIR, 'X-Train-sources.hkl')

val_sources = os.path.join(DATA_DIR, 'X-Val-sources.hkl')

val_file=os.path.join(DATA_DIR, 'X-Val.hkl')

json_file = open(MODEL_DATA_DIR+'prednet_kitti_model.json' , 'r')

loaded_model_json = json_file.read()

json_file.close()


model = model_from_json(loaded_model_json,custom_objects = {'PredNet': PredNet})

model.load_weights(MODEL_DATA_DIR+"prednet_kitti_weights.hdf5")

model.compile(loss='mean_absolute_error', optimizer='adam')


layer_config = model.layers[1].get_config()
layer_config['output_mode'] = 'R0'
dim_ordering = layer_config['dim_ordering']

clf_prednet = PredNet(weights=model.layers[1].get_weights(), **layer_config)

input_shape = list(model.layers[0].batch_input_shape[1:])

input_shape[0] = nt

inputs = Input(shape=tuple(input_shape))

predictions = clf_prednet(inputs)

pred_shape=predictions.get_shape()

#flat=Flatten()(predictions)

out = Flatten()(predictions)


x= Dense(10, activation='softmax',input_shape=pred_shape)(out)

model = Model(input=inputs, output=x)


test_generator = SequenceGenerator(val_file, val_sources,nt,sequence_start_mode='unique', dim_ordering=dim_ordering)

Error Info

usr/lib/python2.7/site-packages/keras/initializations.py:65: RuntimeWarning: invalid value encountered in sqrt
  s = np.sqrt(6. / (fan_in + fan_out))
Traceback (most recent call last):
  File "test.py", line 86, in <module>
    x= Dense(10, activation='softmax',input_shape=pred_shape)(out)
  File "/usr/lib/python2.7/site-packages/keras/engine/topology.py", line 546, in __call__
    self.build(input_shapes[0])
  File "/usr/lib/python2.7/site-packages/keras/layers/core.py", line 797, in build
    constraint=self.W_constraint)
  File "/usr/lib/python2.7/site-packages/keras/engine/topology.py", line 418, in add_weight
    weight = initializer(shape, name=name)
  File "/usr/lib/python2.7/site-packages/keras/initializations.py", line 66, in glorot_uniform
    return uniform(shape, s, name=name)
  File "/usr/lib/python2.7/site-packages/keras/initializations.py", line 33, in uniform
    return K.random_uniform_variable(shape, -scale, scale, name=name)
  File "/usr/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 622, in random_uniform_variable
    low, high, dtype=tf_dtype, seed=seed)(shape)
  File "/usr/lib/python2.7/site-packages/tensorflow/python/ops/init_ops.py", line 171, in _initializer
    return random_ops.random_uniform(shape, minval, maxval, dtype, seed=seed)
  File "/usr/lib/python2.7/site-packages/tensorflow/python/ops/random_ops.py", line 245, in random_uniform
    seed2=seed2)
  File "/usr/lib/python2.7/site-packages/tensorflow/python/ops/gen_random_ops.py", line 220, in _random_uniform
    seed=seed, seed2=seed2, name=name)
  File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 759, in apply_op
    op_def=op_def)
  File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2242, in create_op
    set_shapes_for_outputs(ret)
  File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1617, in set_shapes_for_outputs
    shapes = shape_func(op)
File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1568, in call_with_requiring
    return call_cpp_shape_fn(op, require_shape_fn=True)
  File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 610, in call_cpp_shape_fn
    debug_python_shape_fn, require_shape_fn)
  File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 660, in _call_cpp_shape_fn_impl
    s = tensor_util.constant_value_as_shape(op.inputs[idx])
  File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 742, in constant_value_as_shape
    [d if d != -1 else None for d in value]))
  File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/tensor_shape.py", line 457, in __init__
    self._dims = [as_dimension(d) for d in dims_iter]
  File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/tensor_shape.py", line 378, in as_dimension
    return Dimension(value)
  File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/tensor_shape.py", line 38, in __init__
    raise ValueError("Dimension %d must be >= 0" % self._value)
ValueError: Dimension -614400 must be >= 0

Many thanks

Trying to use predenet on different data.

Hi,
I'm trying to use predenet on a different dataset of mine. The frames have the same size as the Kitti dataset but the code to pre-process the data still failing. I'm wondering , can I use predenet on different data if the frames have the same size as the Kitti dataset or I need to do some kind of pre-processing on the data before running the code to do the pre-process ?
Thanks in advance.

1 input -> next predicted output

Hi

thank for your code

i want only predicted output which is predicted based on previous input sequence
not to compare actual and predicted output
to predict future situation just using present situation

how can i do this??

Thx.

ValueError: You are trying to load a weight file containing 3 layers into a model with 1 layers.

Hello all,

I am trying to run PredNet on a cluster with keras 1.2.0 and theano 0.8.2, and when I run kitti_evaluate.py I get the message:
python-2.7.9/lib/python2.7/site-packages/keras/engine/topology.py:368: UserWarning: The regularizers property of layers/models is deprecated. Regularization losses are now managed via the losses layer/model property.
warnings.warn('The regularizers property of '
Traceback (most recent call last):
File "kitti_evaluate.py", line 37, in
train_model.load_weights(weights_file)
File "python2.7/site-packages/keras/engine/topology.py", line 2701, in load_weights
self.load_weights_from_hdf5_group(f)
File "python-2.7.9/lib/python2.7/site-packages/keras/engine/topology.py", line 2753, in load_weights_from_hdf5_group
str(len(flattened_layers)) + ' layers.')
ValueError: You are trying to load a weight file containing 3 layers into a model with 1 layers.

I haven't been able to find any information as to what might be causing this.

Additionally, when I try to run kitti_train I get the following:
Traceback (most recent call last):
File "kitti_train.py", line 59, in
errors_by_time = TimeDistributed(Dense(1, weights=[layer_loss_weights, np.zeros(1)], trainable=False), trainable=False)(errors) # calculate weighted error by layer
File "python-2.7.9/lib/python2.7/site-packages/keras/engine/topology.py", line 543, in call
self.build(input_shapes[0])
File "python-2.7.9/lib/python2.7/site-packages/keras/layers/wrappers.py", line 98, in build
self.layer.build(child_input_shape)
File "python-2.7.9/lib/python2.7/site-packages/keras/layers/core.py", line 763, in build
self.set_weights(self.initial_weights)
File "python-2.7.9/lib/python2.7/site-packages/keras/engine/topology.py", line 966, in set_weights
str(weights)[:50] + '...')
ValueError: You called set_weights(weights) on layer "dense_1" with a weight list of length 2, but the layer was expecting 0 weights. Provided weights: [array([[ 1.],
[ 0.],
[ 0.],
...

I haven't been able to figure out any way around these issues, the weights files I am using are downloaded with download_models.sh

Custom Crop Size

How to change the image crop size? I'm having a problem when I change it to (480,size)

Code:

n_channels, im_height, im_width = (3, 480, 320)
input_shape = (n_channels, im_height, im_width) if K.image_data_format() == 'channels_first' else (im_height, im_width, n_channels)
print(input_shape)
stack_sizes = (n_channels, 48, 96, 192)

Error:
ValueError: Error when checking input: expected input_1 to have shape (None, 10, 480, 320, 3) but got array with shape (4, 10, 128, 160, 3)

Cannot reproduce paper results with downloaded weights

Hi thanks for releasing the code for your model. I used the downloaded weights/data and kitti_evaluate.py with keras 1.2.1, cuDNN v5.1 and python 2.7.12 for the L0 model.
The pictures don't look bad but the MSE seems a bit off.

with tensorflow 0.12.1:
Model MSE: 0.008421
Previous Frame MSE: 0.021246

with theano 0.9.0:
Model MSE: 0.006995
Previous Frame MSE: 0.021246

Should the model MSE be 0.00313?
Why does prednet_kitti_model.json specify: "keras_version": "1.0.7"?
And what is your validation MAE at the end of training at epoch 150?

Thanks

I also got the same results using keras commit 3a7cd05b488e327c1adccaaff10c78390d53b5a8

How to generate multiple future frames from only a single input frame as a context ?

Hello,
I wish to know how can I make multi-step predictions from a single input frame, or more specifically, which parameters need to be tweaked to get the job done. I tried reducing 'td' down to 1, and recursively feeding the input back into the network (like the paper says). However, the output to the very first frame produces a dead output (gray image), which propogates and causes the loop predictions ahead to produce dead images again, without making any real predictions. Please correct me if I'm passing the input incorrectly.
Hoping for a quick response.
Many Thanks !

AttributeError: 'PredNet' object has no attribute 'units'

Hi,
I'm using python=2.7, tensorflow=1.5.0, keras=2.0.2 and I'm facing issue with prednet_train.py

Traceback (most recent call last):
  File "train.py", line 59, in <module>
    errors = prednet(inputs)    # (?, nt, nb_layers)
  File "/home/ubuntu/.virtualenvs/keras_tf/local/lib/python2.7/site-packages/keras/layers/recurrent.py", line 252, in __call__
    return super(Recurrent, self).__call__(inputs, **kwargs)
  File "/home/ubuntu/.virtualenvs/keras_tf/local/lib/python2.7/site-packages/keras/engine/topology.py", line 554, in __call__
    output = self.call(inputs, **kwargs)
  File "/home/ubuntu/.virtualenvs/keras_tf/local/lib/python2.7/site-packages/keras/layers/recurrent.py", line 269, in call
    initial_states = self.get_initial_states(inputs)
  File "/home/ubuntu/.virtualenvs/keras_tf/local/lib/python2.7/site-packages/keras/layers/recurrent.py", line 218, in get_initial_states
    initial_state = K.tile(initial_state, [1, self.units])  # (samples, output_dim)
AttributeError: 'PredNet' object has no attribute 'units'

about CalTech dataset

When i using the CalTech Pedestrian dataset to test, I get the SSIM 0.93 that is higher than the paper got, I think it is because the frame rate is not match the KITTI dataset, so can you tell me what your process in the CalTech data, what is the frame rate?

Problem with the file kitti_evaluate.py

I am using Windows 7, Anaconda2, python 2.7.12, Theano 0.9.0, keras 1.1.2.
I downloaded the processed data from the files: download_data.sh and download_files.sh. Then I am trying to run the kitti_evaluate.py file through Anaconda promt. The file runs, but no Result_data file is created and no plot is shown. I get this:
untitled

I am very new to python, I don't understand what it means. I suspect it might be a problem of theano. Can anyone help??
Thanks in advance!!

kitti_train.py throws error

wireless@wireless-Precision-7510:~/git-clones/prednet$ python kitti_train.py
Using TensorFlow backend.
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py:1255: calling reduce_sum (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py:1272: calling reduce_prod (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py:1357: calling reduce_mean (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
2017-12-05 15:56:18.571703: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:895] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2017-12-05 15:56:18.572021: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1062] Found device 0 with properties:
name: Quadro M2000M major: 5 minor: 0 memoryClockRate(GHz): 1.137
pciBusID: 0000:01:00.0
totalMemory: 3.94GiB freeMemory: 3.29GiB
2017-12-05 15:56:18.572033: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1152] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: Quadro M2000M, pci bus id: 0000:01:00.0, compute capability: 5.0)
Epoch 1/150
Traceback (most recent call last):
File "kitti_train.py", line 76, in
validation_data=val_generator, validation_steps=N_seq_val / batch_size)
File "/usr/local/lib/python2.7/dist-packages/keras/legacy/interfaces.py", line 87, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/training.py", line 2115, in fit_generator
generator_output = next(output_generator)
File "/usr/local/lib/python2.7/dist-packages/keras/utils/data_utils.py", line 560, in get
six.raise_from(StopIteration(e), e)
File "/usr/local/lib/python2.7/dist-packages/six.py", line 737, in raise_from
raise value
StopIteration

This is the output of running kitti_train.py, unmodified. I'm using Tensorflow 1.4.0, Keras 2.1.2 on a Quadro M2000M. Has anyone else seen this error?

Training Model on Higher Image size of 957x526.

I have GTA data that is HD. I am trying to train the model on (957x526) image size. I changed the input shape to (3, 957, 526) and nt =10.

  File "kitti_train.py", line 58, in <module>
    errors = prednet(inputs)  # errors will be (batch_size, nt, nb_layers)
  File "/usr/local/lib/python2.7/dist-packages/keras/layers/recurrent.py", line 268, in __call__
    return super(Recurrent, self).__call__(inputs, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 602, in __call__
    output = self.call(inputs, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/keras/layers/recurrent.py", line 348, in call
    input_length=timesteps)
  File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 2467, in rnn
    outputs, _ = step_function(inputs[0], initial_states + constants)
  File "/root/home/intern1/prednet/GTA/prednet.py", line 240, in step
    inputs = K.concatenate(inputs, axis=self.channel_axis)
  File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 1709, in 
concatenate
    return tf.concat([to_dense(x) for x in tensors], axis)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 1099, in 
concat
    return gen_array_ops._concat_v2(values=values, axis=axis, name=name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_array_ops.py", line 706, in 
_concat_v2
    "ConcatV2", values=values, axis=axis, name=name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 
787, in _apply_op_helper
   op_def=op_def)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2958, in 
create_op
    set_shapes_for_outputs(ret)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2209, in 
set_shapes_for_outputs
    shapes = shape_func(op)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2159, in 
call_with_requiring
    return call_cpp_shape_fn(op, require_shape_fn=True)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/common_shapes.py", line 
627, in call_cpp_shape_fn
    require_shape_fn)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/common_shapes.py", line 
691, in _call_cpp_shape_fn_impl
    raise ValueError(err.message)
ValueError: Dimension 1 in both shapes must be equal, but are 239 and 238 for 'pred_net_1/concat_1' (op: 'ConcatV2') with input shapes: [?,239,131,96], [?,239,131,192], [?,238,130,192], [] and with computed input tensors: input[3] = <3>.

I just want to know what all do I have to change to Get the training going? I am planning to train this on HD images in future. @bill-lotter @davidcox I need help. I am modifying this for novel idea. It would take a lot of time for me to change all the lines. You guys know it well, so I can get done with this earlier.
Thanks in Advance.

Non-RGB Images

Hello,

Is there anything that needs to be changed to pass in images with channel size of 1 instead of 3 as in RGB within the model (besides setting n_channels)?

Thanks!

Prednet changing colors

I'm using the latest prednet master, Keras 2.0.8, and TF 1.8.0. I'm testing prednet on synthetic videos of moving rectangles. Red rectangles are fine but other colors get changed. For instance if the input video contains yellow rectangles the predicted rectangles are green, and if the input video contains white rectangles the predicted rectangles are cyan. See attached png for an example of the former. The predicted position and shape of the rectangles is fine, just the color is changed. In addition blue and green rectangles produce no predictions at all (a completely black predicted value). Strangely when I ran it on the Kitti data to test the predictions all look fine, so it is not scrambling the colors there.

plot_35

Error when changing the value of extrap_start_time

Traceback (most recent call last):
File "kitti_train.py", line 59, in
errors = prednet(inputs) # errors will be (batch_size, nt, nb_layers)
File "/home/Badour/.local/lib/python2.7/site-packages/keras/engine/topology.py", line 484, in call
self.build(input_shapes[0])
File "/home/Badour/prednet/prednet.py", line 223, in build
self.t_extrap = K.variable(self.extrap_start_time, int)
File "/home/Badour/.local/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 127, in variable
v = tf.Variable(value, dtype=_convert_string_dtype(dtype), name=name)
File "/home/Badour/.local/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 106, in _convert_string_dtype
raise ValueError('Unsupported dtype:', dtype)
ValueError: ('Unsupported dtype:', <type 'int'>)

I'm using:
Python 2.7
tensorflow 0.12.1
Keras 1.0.7
cuDNN 5.1

Error in training

I'm using keras 1.1.0 and theano 0.8.2

The error information is:

Traceback (most recent call last):
File "kitti_train.py", line 59, in
errors_by_time = TimeDistributed(Dense(1, weights=[layer_loss_weights, np.zeros(1)], trainable=False), trainable=False)(errors) # calculate weighted error by layer
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 543, in call
self.build(input_shapes[0])
File "/usr/local/lib/python2.7/dist-packages/keras/layers/wrappers.py", line 98, in build
self.layer.build(child_input_shape)
File "/usr/local/lib/python2.7/dist-packages/keras/layers/core.py", line 763, in build
self.set_weights(self.initial_weights)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 966, in set_weights
str(weights)[:50] + '...')
ValueError: You called set_weights(weights) on layer "dense_1" with a weight list of length 2, but the layer was expecting 0 weights. Provided weights: [array([[ 1.],
[ 0.],
[ 0.],
...

About appendix

HI,@bill-lotter I am very interested in your paper and I have learn a lot from it.I was wondering if you could provide me with the code in the appendix?It is important to me and I will appreciate it very much.
Sorry for bothering.Thank you very much.

Best regards.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.