Code Monkey home page Code Monkey logo

unflow's Introduction

UnFlow: Unsupervised Learning of Optical Flow with a Bidirectional Census Loss

This repository contains the TensorFlow implementation of the paper

UnFlow: Unsupervised Learning of Optical Flow with a Bidirectional Census Loss (AAAI 2018)

Simon Meister, Junhwa Hur, and Stefan Roth.

Slides

Download slides from AAAI 2018 talk.

Citation

If you find UnFlow useful in your research, please consider citing:

@inproceedings{Meister:2018:UUL,
  title  = {{UnFlow}: Unsupervised Learning of Optical Flow
            with a Bidirectional Census Loss},
  author = {Simon Meister and Junhwa Hur and Stefan Roth},
  address = {New Orleans, Louisiana},
  booktitle = {AAAI},
  month = feb,
  year = {2018}
}

License

UnFlow is released under the MIT License (refer to the LICENSE file for details).

Unofficial PyTorch code

There is a unofficial third party PyTorch implementation by Simon Niklaus.

Contents

  1. Introduction
  2. Usage
  3. Replicating our Models
  4. Navigating the Code

Introduction

Our paper describes a method to train end-to-end deep networks for dense optical flow without the need for ground truth optical flow.

NOTE (January 2020): There may be some hiccups with more recent versions of tensorflow due to the unstable custom op compilation API used for the correlation operation. If you experience these issues, please try one of the older tensorflow versions (see list of releases, e.g. 1.2 or 1.7) until I find time to fix these issues. I'm currently too busy with new projects to upgrade the code, and would be happy about any contributions.

This implementation supports all training and evaluation styles described in the paper. This includes

The supported network architectures are FlowNetS, FlowNetC, as well as stacked variants of these networks as introduced in FlowNet 2.0.

All datasets required for training and evaluation are downloaded on-demand by the code (except Cityscapes, which has to be downloaded manually if needed). Please ensure that the data directory specified in the configuration file has enough space to hold at least 150 GB (when using SYNTHIA and KITTI only).

Usage

Please refer to the configuration file template (config_template/config.ini) for a detailed description of the different operating modes.

Hardware requirements

  • at least one NVIDIA GPU (multi-GPU training is supported). We used the Titan X Pascal with 12GB memory.
  • for best performance, at least 8GB of GPU memory is recommended, for the stacked variants 11-12GB may be best
  • to run the code with less GPU memory, take a look at https://github.com/openai/gradient-checkpointing. One user reported successfully running the full CSS model with a GTX 960 with 4GB memory. Note that training will take longer in that case.

Software requirements

  • python 3
  • gcc4
  • RAR backend tool for rarfile (see https://pypi.python.org/pypi/rarfile/)
  • python packages: matplotlib pypng rarfile pillow and tensorflow-gpu (at least version 1.7)
  • CUDA and CuDNN. You should use the installer downloaded from the NVIDIA website and install to /usr/local/cuda. Please make sure that the versions you install are compatible with the version of tensorflow-gpu you are using (see e.g. https://github.com/tensorflow/tensorflow/releases).

Prepare environment

  • copy config_template/config.ini to ./ and modify settings in the [dir], [run] and [compile] sections for your environment (see comments in the file).

Run & evaluate experiments

  • adapt settings in ./config.ini for your experiment
  • cd src
  • train with python run.py --ex my_experiment. Evaluation is run during training as specified in config.ini, but no visualizations are saved.
  • evaluate (multiple) experiments with python eval_gui.py --ex experiment_name_1[, experiment_name_2 [...]] and visually compare results side-by-side.

You can use the --help flag with run.py or eval_gui.py to view all available flags.

View tensorboard logs

  • view logs for all experiments with tensorboard --logdir=<log_dir>/ex

Pre-trained models

We provide checkpoints for the C_SYNTHIA, CS_SYNTHIA, CSS_SYNTHIA, C, CS, CSS and CSS_ft models (see "Replicating our models" for a description). To use them,

  • download this file and extract the contents to <log_dir>/ex/.

Now, you can evaluate and compare different models, e.g.

  • python eval_gui.py --ex C_SYNTHIA,C,CSS_ft.

Replicating our models

In the following, each list item gives an experiment name and parameters to set in ./config.ini. For each experiment, first modify the configuration parameters as specified, and then run python run.py --ex experiment_name.

First, create a series of experiments for the models pre-trained on SYNTHIA:

  • C_SYNTHIA: dataset = synthia, flownet = C,
  • CS_SYNTHIA: dataset = synthia, flownet = CS, finetune = C_SYNTHIA,
  • CSS_SYNTHIA: dataset = synthia, flownet = CSS, finetune = C_SYNTHIA,CS_SYNTHIA.

Next, create a series of experiments for the models trained on KITTI raw:

  • C: dataset = kitti, flownet = C, finetune = C_SYNTHIA,
  • CS: dataset = kitti, flownet = CS, finetune = C,CS_SYNTHIA,
  • CSS: dataset = kitti, flownet = CSS, finetune = C,CS,CSS_SYNTHIA.

Then, train the final fine-tuned model on KITTI 2012 / 2015:

  • CSS_ft: dataset = kitti_ft, flownet = CSS, finetune = C,CS,CSS, train_all = True. Please monitor the eval logs and stop the training as soon as the validation error starts to increase (for CSS, it should be at about 70K iterations).

If you want to train on Cityscapes:

  • C_Cityscapes: dataset = cityscapes, flownet = C, finetune = C_SYNTHIA.

Note that all models but CSS_ft were trained without ground truth optical flow, using our unsupervised proxy loss only.

Navigating the code

The core implementation of our method resides in src/e2eflow/core. The key files are:

  • losses.py: Proxy losses for unsupervised training,
  • flownet.py: FlowNet architectures with support for stacking,
  • image_warp.py: Backward-warping via differentiable bilinear image sampling,
  • supervised.py: Supervised loss and network computation,
  • unsupervised.py: Unsupervised (bi-directional) multi-resolution network and loss computation,
  • train.py: Implementation of training with online evaluation,
  • augment.py: Geometric and photometric data augmentations.

unflow's People

Contributors

simonmeister 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

unflow's Issues

Some confuse about the function of "create_border_mask"

Hello Simon,
Thanks for your fantastic work and code!
I am new to the task of video and I have a question about the definition of "border_mask " in losses.py:

Why do we need to use these masks when computing CharbonnierLoss?

Thanks so much in advance

Memory leak

The CPU memory goes larger continuously as training until it explode.

Check failed: dim.IsSet() Internal error: Got nullptr for Dimension in downsample

Hello, thanks again for your work!

I have a question. In unsupervised.py I have im1_s, im2_s with shapes (2, 320, 1152, ?). After first downsample(im1_s, 4) shapes became (2, 80, 288, ?), and then in each iteration when computing loss (https://github.com/simonmeister/UnFlow/blob/master/src/e2eflow/core/unsupervised.py#L116)

I have downsample(im1_s, 2) and shapes decreasing twice. So, once, I have shape (2, 5, 18, ?), and there is an error:

/usr/local/lib/python3.5/dist-packages/tensorflow/include/tensorflow/core/framework/shape_inference.h:625] Check failed: dim.IsSet() Internal error: Got nullptr for Dimension
.
Aborted (core dumped)

What can cause such a problem and how can I solve it?

1D Correlation for Stereo Disparity Estimation

Hi, I am quite new to TensorFlow. I was wondering, why do we need CUDA implementation for this, I mean can't we code a correlation function using Python / TensorFlow APIs?

Also, for performing 1D correlation operation in case of stereo disparity estimation, is it okay to just compute dot products of corresponding elements of left / right feature maps (kernel size is thus, 1x1)?

How many iterations does FlownetC need?

I have trained 130400 iterations with batch_size 8 on flying chairs dataset. The predicted flows on test set are still not good. Should I continue or switched to FlownetCS?

How to do BP for occlusion mask penalty?

Hi, @simonmeister
Thanks for your nice work and repo.
I've read your paper and there is one thing that I do not understand.
In equation (2) occlusion mask o_x is penalized with weight lambda_p. However in equation (1) this mask is calculated by comparision. How to do back propagation for this penalty term?
image
image

Thanks~

Limit data download to Kitti?

Hi,

I only want to confirm the data/train on Kitti, so I would like to skip the synthia etc. download.
Is there a parameter in the config file or somewhere else to disable the other downloads?

Kind regards

non-zero exit status 127

I am trying to run the code but this problem appeared to me

raise CalledProcessError(retcode, process.args, output=output)
subprocess.CalledProcessError: Command 'g++-4.9 -std=c++11 -shared -o backward_warp_op.so backward_warp_op.cu.o backward_warp_op.cc -I /home/hzaal/tensorflow/lib/python3.4/site-packages/tensorflow/include -fPIC -lcudart -D GOOGLE_CUDA=1 -L /usr/local/lib64' returned non-zero exit status 127

some problem about multi GPU

now,i was training "C_SYNTHIA",I found that it took the same amount of time to train 5000 iterations of two GPUs or eight GPUs. now num_iters = 500000.The total number of iterations for two GPUs and eight GPUs is 500000? I have setted batch_size of one GPU from 4 to 8, batch_size of two GPU is 16, batch_size of eight GPU is 64.

Pyramidal Decomposition and Downsampling

Hi,
I found a little bug when trying to use smaller images with pyramidal cost function.

In unsupervised.py, we have this in the pyramidal loop:
im1_s = downsample(im1_s, 2) im2_s = downsample(im2_s, 2) mask_s = downsample(mask_s, 2)

But sometimes it's just not possible to do so (image size no divisible by 2). What I'm doing for now is just to limit the number of pyramidal images in Python, but I believe that a minimal modification in the C++ would be the proper solution.

Thanks.

unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h

I am using tf1.9 on ubuntu16, but I can't run "python run.py --help", the error info is as follows:
I don't know why, I have upgrade my Eigen, but it didn't work.

`/usr/local/lib/python3.5/dist-packages/tensorflow/include/google/protobuf/arena_impl.h(57): warning: integer conversion resulted in a change of sign

/usr/local/lib/python3.5/dist-packages/tensorflow/include/google/protobuf/arena_impl.h(304): warning: integer conversion resulted in a change of sign

/usr/local/lib/python3.5/dist-packages/tensorflow/include/google/protobuf/arena_impl.h(305): warning: integer conversion resulted in a change of sign

/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(651): warning: missing return statement at end of non-void function "Eigen::internal::igammac_cf_impl<Scalar, mode>::run [with Scalar=float, mode=Eigen::internal::VALUE]"
detected during:
instantiation of "Scalar Eigen::internal::igammac_cf_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=float, mode=Eigen::internal::VALUE]"
(855): here
instantiation of "Scalar Eigen::internal::igamma_generic_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=float, mode=Eigen::internal::VALUE]"
(2096): here
instantiation of "Eigen::internal::igamma_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::igamma(const Scalar &, const Scalar &) [with Scalar=float]"
/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsHalf.h(34): here

/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(712): warning: missing return statement at end of non-void function "Eigen::internal::igamma_series_impl<Scalar, mode>::run [with Scalar=float, mode=Eigen::internal::VALUE]"
detected during:
instantiation of "Scalar Eigen::internal::igamma_series_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=float, mode=Eigen::internal::VALUE]"
(863): here
instantiation of "Scalar Eigen::internal::igamma_generic_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=float, mode=Eigen::internal::VALUE]"
(2096): here
instantiation of "Eigen::internal::igamma_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::igamma(const Scalar &, const Scalar &) [with Scalar=float]"
/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsHalf.h(34): here

/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(651): warning: missing return statement at end of non-void function "Eigen::internal::igammac_cf_impl<Scalar, mode>::run [with Scalar=float, mode=Eigen::internal::DERIVATIVE]"
detected during:
instantiation of "Scalar Eigen::internal::igammac_cf_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=float, mode=Eigen::internal::DERIVATIVE]"
(855): here
instantiation of "Scalar Eigen::internal::igamma_generic_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=float, mode=Eigen::internal::DERIVATIVE]"
(2102): here
instantiation of "Eigen::internal::igamma_der_a_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::igamma_der_a(const Scalar &, const Scalar &) [with Scalar=float]"
/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsHalf.h(38): here

/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(712): warning: missing return statement at end of non-void function "Eigen::internal::igamma_series_impl<Scalar, mode>::run [with Scalar=float, mode=Eigen::internal::DERIVATIVE]"
detected during:
instantiation of "Scalar Eigen::internal::igamma_series_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=float, mode=Eigen::internal::DERIVATIVE]"
(863): here
instantiation of "Scalar Eigen::internal::igamma_generic_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=float, mode=Eigen::internal::DERIVATIVE]"
(2102): here
instantiation of "Eigen::internal::igamma_der_a_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::igamma_der_a(const Scalar &, const Scalar &) [with Scalar=float]"
/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsHalf.h(38): here

/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(651): warning: missing return statement at end of non-void function "Eigen::internal::igammac_cf_impl<Scalar, mode>::run [with Scalar=float, mode=Eigen::internal::SAMPLE_DERIVATIVE]"
detected during:
instantiation of "Scalar Eigen::internal::igammac_cf_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=float, mode=Eigen::internal::SAMPLE_DERIVATIVE]"
(855): here
instantiation of "Scalar Eigen::internal::igamma_generic_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=float, mode=Eigen::internal::SAMPLE_DERIVATIVE]"
(2108): here
instantiation of "Eigen::internal::gamma_sample_der_alpha_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::gamma_sample_der_alpha(const Scalar &, const Scalar &) [with Scalar=float]"
/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsHalf.h(42): here

/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(712): warning: missing return statement at end of non-void function "Eigen::internal::igamma_series_impl<Scalar, mode>::run [with Scalar=float, mode=Eigen::internal::SAMPLE_DERIVATIVE]"
detected during:
instantiation of "Scalar Eigen::internal::igamma_series_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=float, mode=Eigen::internal::SAMPLE_DERIVATIVE]"
(863): here
instantiation of "Scalar Eigen::internal::igamma_generic_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=float, mode=Eigen::internal::SAMPLE_DERIVATIVE]"
(2108): here
instantiation of "Eigen::internal::gamma_sample_der_alpha_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::gamma_sample_der_alpha(const Scalar &, const Scalar &) [with Scalar=float]"
/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsHalf.h(42): here

/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(651): warning: missing return statement at end of non-void function "Eigen::internal::igammac_cf_impl<Scalar, mode>::run [with Scalar=double, mode=Eigen::internal::VALUE]"
detected during:
instantiation of "Scalar Eigen::internal::igammac_cf_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=double, mode=Eigen::internal::VALUE]"
(855): here
instantiation of "Scalar Eigen::internal::igamma_generic_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=double, mode=Eigen::internal::VALUE]"
(2096): here
instantiation of "Eigen::internal::igamma_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::igamma(const Scalar &, const Scalar &) [with Scalar=double]"
/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h(120): here

/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(712): warning: missing return statement at end of non-void function "Eigen::internal::igamma_series_impl<Scalar, mode>::run [with Scalar=double, mode=Eigen::internal::VALUE]"
detected during:
instantiation of "Scalar Eigen::internal::igamma_series_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=double, mode=Eigen::internal::VALUE]"
(863): here
instantiation of "Scalar Eigen::internal::igamma_generic_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=double, mode=Eigen::internal::VALUE]"
(2096): here
instantiation of "Eigen::internal::igamma_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::igamma(const Scalar &, const Scalar &) [with Scalar=double]"
/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h(120): here

/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(651): warning: missing return statement at end of non-void function "Eigen::internal::igammac_cf_impl<Scalar, mode>::run [with Scalar=double, mode=Eigen::internal::DERIVATIVE]"
detected during:
instantiation of "Scalar Eigen::internal::igammac_cf_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=double, mode=Eigen::internal::DERIVATIVE]"
(855): here
instantiation of "Scalar Eigen::internal::igamma_generic_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=double, mode=Eigen::internal::DERIVATIVE]"
(2102): here
instantiation of "Eigen::internal::igamma_der_a_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::igamma_der_a(const Scalar &, const Scalar &) [with Scalar=double]"
/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h(135): here

/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(712): warning: missing return statement at end of non-void function "Eigen::internal::igamma_series_impl<Scalar, mode>::run [with Scalar=double, mode=Eigen::internal::DERIVATIVE]"
detected during:
instantiation of "Scalar Eigen::internal::igamma_series_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=double, mode=Eigen::internal::DERIVATIVE]"
(863): here
instantiation of "Scalar Eigen::internal::igamma_generic_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=double, mode=Eigen::internal::DERIVATIVE]"
(2102): here
instantiation of "Eigen::internal::igamma_der_a_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::igamma_der_a(const Scalar &, const Scalar &) [with Scalar=double]"
/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h(135): here

/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(651): warning: missing return statement at end of non-void function "Eigen::internal::igammac_cf_impl<Scalar, mode>::run [with Scalar=double, mode=Eigen::internal::SAMPLE_DERIVATIVE]"
detected during:
instantiation of "Scalar Eigen::internal::igammac_cf_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=double, mode=Eigen::internal::SAMPLE_DERIVATIVE]"
(855): here
instantiation of "Scalar Eigen::internal::igamma_generic_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=double, mode=Eigen::internal::SAMPLE_DERIVATIVE]"
(2108): here
instantiation of "Eigen::internal::gamma_sample_der_alpha_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::gamma_sample_der_alpha(const Scalar &, const Scalar &) [with Scalar=double]"
/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h(154): here

/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(712): warning: missing return statement at end of non-void function "Eigen::internal::igamma_series_impl<Scalar, mode>::run [with Scalar=double, mode=Eigen::internal::SAMPLE_DERIVATIVE]"
detected during:
instantiation of "Scalar Eigen::internal::igamma_series_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=double, mode=Eigen::internal::SAMPLE_DERIVATIVE]"
(863): here
instantiation of "Scalar Eigen::internal::igamma_generic_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=double, mode=Eigen::internal::SAMPLE_DERIVATIVE]"
(2108): here
instantiation of "Eigen::internal::gamma_sample_der_alpha_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::gamma_sample_der_alpha(const Scalar &, const Scalar &) [with Scalar=double]"
/usr/local/lib/python3.5/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h(154): here

/usr/local/lib/python3.5/dist-packages/tensorflow/include/google/protobuf/arena_impl.h(57): warning: integer conversion resulted in a change of sign

/usr/local/lib/python3.5/dist-packages/tensorflow/include/google/protobuf/arena_impl.h(304): warning: integer conversion resulted in a change of sign

/usr/local/lib/python3.5/dist-packages/tensorflow/include/google/protobuf/arena_impl.h(305): warning: integer conversion resulted in a change of sign

/usr/local/lib/python3.5/dist-packages/tensorflow/include/google/protobuf/generated_message_reflection.h(685): warning: variable "unused" was set but never used

Traceback (most recent call last):
File "/data/BasicAlg/zhoujiqiang/OpticalFlow/UnFlow-master/src/e2eflow/ops.py", line 61, in
op_lib = tf.load_op_library(lib_path)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/load_library.py", line 56, in load_op_library
lib_handle = py_tf.TF_LoadLibrary(library_filename)
tensorflow.python.framework.errors_impl.NotFoundError: ./backward_warp_op.so: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "run.py", line 7, in
from e2eflow.core.train import Trainer
File "/data/BasicAlg/zhoujiqiang/OpticalFlow/UnFlow-master/src/e2eflow/core/train.py", line 12, in
from ..ops import forward_warp
File "/data/BasicAlg/zhoujiqiang/OpticalFlow/UnFlow-master/src/e2eflow/ops.py", line 63, in
compile(n)
File "/data/BasicAlg/zhoujiqiang/OpticalFlow/UnFlow-master/src/e2eflow/ops.py", line 47, in compile
gcc_cmd = gcc_cmd.format(config['compile']['g++'],
File "/usr/lib/python3.5/configparser.py", line 956, in getitem
raise KeyError(key)
KeyError: 'compile'
`

How to obtain the .so files?

When I try to run the code according to the README instructions, I get an error that certain .so files are not found. Indeed, the necessary .cc and .h files are in the ops directory, but no .so or .o files.

How can I obtain them? Or are they supposed to be generated somehow at first?

(Maybe I have more general understanding problem: What does ops actually stand for?)

Pre-train on Synthia

Hi, thanks for the wonderful code, it is really great work. I have several questions on the pre-training of Synthia.

  1. I saw you only used 10 sequences from the dataset to do the pre-training, why not use more? Is it because as you said in the discussion: unsupervised approaches are limited by the loss function? So even we have more data, the loss function can't lead us to better results? Thanks.

  2. During pre-training, the occlusion is not handled. Is there a reason why you don't use occlusion mask for pre-training?

  3. In your provided config.ini file, the pre-training iteration is 500K, instead of 300K as in the paper.

Thank you very much.

converge too slow

hi,
Thanks for your excellent code!
I use UnFlow to train flownet-C using Chairs dataset, but during the 0-70k iters, the loss maintain 27.xx, after 70k iters, it converges, but I didn't change the learning rate. Why? I also see this phenomenon in other experiments.
following is my loss
image

Thank you!

C++ files of the image_warp function needed to be compiled?

In your folder,image_warp function has been designed using python and tensorflow . And you still have compiled the c++ files in src/e2eflow/ops.py to compute the gradients of image_warp.I think it is unnecessary because the back propogation will be calculated automatically if you use python statement and the c++ files used in Caffe should not be here anymore. Am i wrong?

Running UnFlow on new sets of images/video

Hi, I saw a question about this earlier, but it seemed as though the author resolved it on their own.
How can I can use a pretrained model, i.e. CSS, to run with other input images of different size?
Thanks!

Questions about image for loss comparisons and for neural network

Hi, simon! Thank you for your code and work.
Now I have some questions, I hope you can give me some advices.
In the file unsupervised.py, line 68 says that images for neural network input with mean-zero values in [-1, 1]. But in common sense, the images for neural network should be subtracted by their mean, and divided by their stddev. Why do you just divide images by 255.0? Why should the images for network have the value in [-1, 1]?
And line 65 says that images for loss comparison with values in [0,1], I wonder whether this operation is necessary? Can I directly set the raw images with values in [0, 255.0] to calculate the loss?
Thank you very much!

Doesn't work if cuda is not installed in usr/local

If cuda is not installed in 'usr/local', it does not run correctly.
This is due to lines 42 and 46 in ops.py

Note also that lines 37-40 are not used in ops.py, and therefore neither is line 17 in config.ini.

My simple fix to this was to replace lines 37 to 46 in ops.py with the following:

    out, err = subprocess.Popen(['which', 'nvcc'], stdout=subprocess.PIPE).communicate()
    cuda_dir = out.decode().split('/cuda')[0]

    nvcc_cmd = "nvcc -std=c++11 -c -o {} {} {} -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -I " + cuda_dir + " --expt-relaxed-constexpr"
    nvcc_cmd = nvcc_cmd.format(" ".join([fn_cu_o, fn_cu_cc]),
                               tf_inc, tf_lib)
    subprocess.check_output(nvcc_cmd, shell=True)
    gcc_cmd = "{} -std=c++11 -shared -o {} {} -fPIC -L " + cuda_dir + "/cuda/lib64 -lcudart {} -O2 -D GOOGLE_CUDA=1"

I also removed line 17 from config.ini

Finally, I know this is a custom config file, but I would also suggest perhaps changing line 15 in config.ini to

g++ = g++

I have tested on 3 different machines, all with different versions of linux, tensorflow, and cuda. With these small changes, your code runs immediately following a clone from this repo on all of them (after copying over the config.ini file of course.)

Just a few small suggestions to make things as out-the-box as possible! :)

Pretrained Weights

Are any pretrained weights available to download from the paper to try the model without having to train?
Thanks

Implementation question about occlusion flag calculation

Hi, @simonmeister.
Thanks for make your work publicly available.

Now, I have one question about the implementation of occlusion flag calculation in Eq.1 in the original paper.
In this repository, the calculation is implemented as below,

mag_sq = length_sq(flow_fw) + length_sq(flow_bw)

but fllowing your paper, I think this operation should use warped flow, like

mag_sq_fw = length_sq(flow_fw) + length_sq(flow_bw_warped) 
# and
mag_sq_bw = length_sq(flow_bw) + length_sq(flow_fw_warped)

Is there any reason of the current implementation?, if so, I would appreciate if you tell me the reason.

Yours sincerely,
Daigo Hirooka.

Please help, error! when run python3 run.py --ex test

I have one GPU, I have configured config.in. What have I done wrong here?

/usr/lib/python3/dist-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
/usr/local/lib/python3.6/dist-packages/tensorflow/include/tensorflow/core/lib/bfloat16/bfloat16.h(466): error: no suitable constructor exists to convert from "float" to "tensorflow::bfloat16"

/usr/local/lib/python3.6/dist-packages/tensorflow/include/tensorflow/core/lib/bfloat16/bfloat16.h(467): error: no suitable constructor exists to convert from "float" to "tensorflow::bfloat16"

/usr/local/lib/python3.6/dist-packages/tensorflow/include/tensorflow/core/lib/bfloat16/bfloat16.h(468): error: no suitable constructor exists to convert from "float" to "tensorflow::bfloat16"

/usr/local/lib/python3.6/dist-packages/tensorflow/include/google/protobuf/arena_impl.h(57): warning: integer conversion resulted in a change of sign

/usr/local/lib/python3.6/dist-packages/tensorflow/include/google/protobuf/arena_impl.h(304): warning: integer conversion resulted in a change of sign

/usr/local/lib/python3.6/dist-packages/tensorflow/include/google/protobuf/arena_impl.h(305): warning: integer conversion resulted in a change of sign

/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(108): error: static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
detected during:
instantiation of "Scalar Eigen::internal::lgamma_impl::run(Scalar) [with Scalar=double]"
(1517): here
instantiation of "Eigen::internal::lgamma_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::lgamma(const Scalar &) [with Scalar=double]"
/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h(32): here

/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(1015): error: static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
detected during:
instantiation of "Scalar Eigen::internal::polygamma_impl::run(Scalar, Scalar) [with Scalar=float]"
(1535): here
instantiation of "Eigen::internal::polygamma_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::polygamma(const Scalar &, const Scalar &) [with Scalar=float]"
/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h(67): here

/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(1015): error: static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
detected during:
instantiation of "Scalar Eigen::internal::polygamma_impl::run(Scalar, Scalar) [with Scalar=double]"
(1535): here
instantiation of "Eigen::internal::polygamma_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::polygamma(const Scalar &, const Scalar &) [with Scalar=double]"
/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h(74): here

/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(342): error: static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
detected during:
instantiation of "Scalar Eigen::internal::erf_impl::run(Scalar) [with Scalar=double]"
(1541): here
instantiation of "Eigen::internal::erf_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::erf(const Scalar &) [with Scalar=double]"
/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h(87): here

/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(375): error: static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
detected during:
instantiation of "Scalar Eigen::internal::erfc_impl::run(Scalar) [with Scalar=float]"
(1547): here
instantiation of "Eigen::internal::erfc_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::erfc(const Scalar &) [with Scalar=float]"
/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h(94): here

/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(375): error: static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
detected during:
instantiation of "Scalar Eigen::internal::erfc_impl::run(Scalar) [with Scalar=double]"
(1547): here
instantiation of "Eigen::internal::erfc_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::erfc(const Scalar &) [with Scalar=double]"
/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h(101): here

/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(649): error: static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
detected during:
instantiation of "Scalar Eigen::internal::igamma_impl::run(Scalar, Scalar) [with Scalar=float]"
(1553): here
instantiation of "Eigen::internal::igamma_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::igamma(const Scalar &, const Scalar &) [with Scalar=float]"
/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h(110): here

/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(649): error: static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
detected during:
instantiation of "Scalar Eigen::internal::igamma_impl::run(Scalar, Scalar) [with Scalar=double]"
(1553): here
instantiation of "Eigen::internal::igamma_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::igamma(const Scalar &, const Scalar &) [with Scalar=double]"
/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h(120): here

/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(461): error: static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
detected during:
instantiation of "Scalar Eigen::internal::igammac_impl::run(Scalar, Scalar) [with Scalar=float]"
(1559): here
instantiation of "Eigen::internal::igammac_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::igammac(const Scalar &, const Scalar &) [with Scalar=float]"
/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h(128): here

/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(461): error: static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
detected during:
instantiation of "Scalar Eigen::internal::igammac_impl::run(Scalar, Scalar) [with Scalar=double]"
(1559): here
instantiation of "Eigen::internal::igammac_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::igammac(const Scalar &, const Scalar &) [with Scalar=double]"
/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h(138): here

/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(1064): error: static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
detected during:
instantiation of "Scalar Eigen::internal::betainc_impl::run(Scalar, Scalar, Scalar) [with Scalar=float]"
(1565): here
instantiation of "Eigen::internal::betainc_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::betainc(const Scalar &, const Scalar &, const Scalar &) [with Scalar=float]"
/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h(146): here

/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/SpecialFunctionsImpl.h(1064): error: static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
detected during:
instantiation of "Scalar Eigen::internal::betainc_impl::run(Scalar, Scalar, Scalar) [with Scalar=double]"
(1565): here
instantiation of "Eigen::internal::betainc_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::betainc(const Scalar &, const Scalar &, const Scalar &) [with Scalar=double]"
/usr/local/lib/python3.6/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h(156): here

15 errors detected in the compilation of "/tmp/tmpxft_000013b5_00000000-6_backward_warp_op.cu.cpp1.ii".
Traceback (most recent call last):
File "/home/cislab315/deeplearning/UnFlow/src/e2eflow/ops.py", line 61, in
op_lib = tf.load_op_library(lib_path)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/load_library.py", line 56, in load_op_library
lib_handle = py_tf.TF_LoadLibrary(library_filename)
tensorflow.python.framework.errors_impl.NotFoundError: ./backward_warp_op.so: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "run.py", line 7, in
from e2eflow.core.train import Trainer
File "/home/cislab315/deeplearning/UnFlow/src/e2eflow/core/train.py", line 12, in
from ..ops import forward_warp
File "/home/cislab315/deeplearning/UnFlow/src/e2eflow/ops.py", line 63, in
compile(n)
File "/home/cislab315/deeplearning/UnFlow/src/e2eflow/ops.py", line 45, in compile
subprocess.check_output(nvcc_cmd, shell=True)
File "/usr/lib/python3.6/subprocess.py", line 336, in check_output
**kwargs).stdout
File "/usr/lib/python3.6/subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'nvcc -std=c++11 -c -o backward_warp_op.cu.o backward_warp_op.cu.cc -I/usr/local/lib/python3.6/dist-packages/tensorflow/include -D_GLIBCXX_USE_CXX11_ABI=0 -L/usr/local/lib/python3.6/dist-packages/tensorflow -ltensorflow_framework -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -I /usr/local --expt-relaxed-constexpr' returned non-zero exit status 1.

regarding image normalization

Hi, I see that you perform mean normalization with:

mean = [104.920005, 110.1753, 114.785955]
stddev = 1 / 0.0039216

Are these values from ImageNet dataset? I'm curious to know if performing normalization considerably affected (improved) your results? I believe none of the papers (your's included) explicitly mention about input image normalization for optical flow. Thanks!

Do you write UnFlow using pytorch?

Hi, I like your paper very much. I would like to use pytorch to build my model. But I only find tensorflow
version. If I want to use this loss function in my pytorch model, should I write the loss function by myself?

Thank you in advance

Out of date download URLs

Hi,

The URLs provided in the code for KITTI seemed to no longer work.
So I to updated data.py at line 82-84 with the following:

KITTI_RAW_URL = 'https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/'
KITTI_2012_URL = 'https://s3.eu-central-1.amazonaws.com/avg-kitti/data_stereo_flow.zip'
KITTI_2015_URL = 'https://s3.eu-central-1.amazonaws.com/avg-kitti/data_scene_flow.zip'

This is just a suggestion to update the code with the updated URLs.

"Converting sparse IndexedSlices to a dense Tensor of unknown shape. "

Hi Simon,

I'm training your network with other datasets and it takes around 1h20min for each 5000 iterations, is that normal?
GTX 1080, CUDA 9.0, TensorFlow 1.7, Cudnn 7005, python 3.5, anaconda3.

I got the following warning, do you get that too?

/home/gsaibro/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/ops/gradients_impl.py:100: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory.

No OpKernel was registered to support Op 'Correlation' with these attrs.

Hi,

Thank you for your work.
I am facing a problem which I cannot fully understand... It seems that it is related to "correlation_op.cc"
Could you help me with that?
Thanks. :)

My settings are:
Python 3.5 (with Anaconda)
Cuda 8.0
Tensorflow-gpu 1.10

I run the following command and set the corresponding "gpu_list=0" in "config_ini":
CUDA_VISIBLE_DEVICES=0 python3 run.py --ex my_experiment

And I got the following errors:
Traceback (most recent call last):
File "/home/runzeli/anaconda3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1278, in _do_call
return fn(*args)
File "/home/runzeli/anaconda3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1261, in _run_fn
self._extend_graph()
File "/home/runzeli/anaconda3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1295, in _extend_graph
tf_session.ExtendSession(self._session)
tensorflow.python.framework.errors_impl.InvalidArgumentError: No OpKernel was registered to support Op 'Correlation' with these attrs. Registered devices: [CPU,GPU], Registered kernels:

 [[Node: flownet_c/Correlation = Correlation[kernel_size=1, max_displacement=20, pad=20, stride_1=1, stride_2=2, _device="/device:GPU:3"](flownet_c_features/conv3/leaky_relu/Maximum, flownet_c_features/conv3_1/leaky_relu/Maximum)]]

Invalid argument: Input height and width must be divisible by scale

Hi Simon!
Thanks for your work and code, it's very helpful to me!
But I have some questions now, please give me some advices.
I want to train your network on my own datasets, but the size of my data is different from kitti or synthia. So I have to reset the height and weight parameter in config.ini.
The question is when I set height and weight to 1000( the size of my data is 4000*4000) and try to run the code, I'll get informations shown below:

tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input height and width must be divisible by scale
[[Node: loss3/Downsample = Downsample[scale=2, _device="/job:localhost/replica:0/task:0/gpu:0"]]

I'm so confused about the reason causing this problem, please help me out.
By the way, I find the size of synthia is 760*1280, and the height and width is set to 448, 640 in train_synthia in config.ini. 640 is the half of the 1280, but how we get the 448? Why not the 380, the half of the 760?

Thanks so much in advance!

Questions about random affine augmentation

Hi Simon, I got another question about the random affine augmentation during training. The code snippet is here. I don't understand why there is a local augmentation on the im2_geo again. Is it because we want more distortions? I saw similar operation in Jason's UnsupFlowNet caffe implementation before. I didn't figure out either. So could you give me some help here? Thank you.

Why require an even number of frames?

Hi,

Am I correct in the assumption, that both for training and for evaluation, an even number of input frames is required, and from these, non-overlapping pairs are built? I.e. if I have 10 input frames (im0, ..., im9) for evaluation, this will result in 5 image pairs for evaluation, ([im0, im1], [im2, im3], ...)?

If yes, why not increase the number of pairs by using all possible consecutive pairs ([im0, im1], [im1, im2], ...)? So e.g. with 10 input frames, there would be 9 pairs for evaluation.

Is this maybe specific to the data used? If I use my own data, any potential pitfalls in increasing the amount of data in this way?

cf. https://github.com/simonmeister/UnFlow/blob/master/src/e2eflow/core/input.py#L88

error with tensorflow

Hi,
I try to run the code: python run.py --ex my_experiment
but there are two errors, as shown following:
and i use tensorlow1.7.0, and my os is ubuntu16.04

image

occ loss implementation problem

Hi,

in losses.py, forward-backward occlusion loss is implemented as:

...
    flow_diff_bw = flow_bw + flow_fw_warped
...
    fb_occ_bw = tf.cast(length_sq(flow_diff_bw) > occ_thresh, tf.float32)
...
        mask_bw *= (1 - fb_occ_bw)
...
    occ_bw = 1 - mask_bw
...
    losses['occ'] = (charbonnier_loss(occ_fw) +
                     charbonnier_loss(occ_bw))
...

However, gradients cannot BP through the tf.greater operation:

    test_g = tf.gradients(occ_bw, flow_diff_bw)
    print("occ gradient: %s" % test_g)

would output [None].

Does that means the occ loss is not working?

correct me if anything wrong,

Thanks

ResourceExhaustedError - conv6

Hello! Thank you for work!

But I have a question. I'm trying to run run.py with kitti dataset. But I got an error ResourceExhaustedError (see above for traceback): OOM when allocating tensor of shape [1024] and type float [[Node: flownet_c/conv6/biases/Adam/Initializer/zeros = Const[_class=["loc:@flownet_c/conv6/biases"], dtype=DT_FLOAT, value=Tensor<type: float shape: [1024] values: 0 0 0...>, _device="/job:localhost/replica:0/task:0/gpu:0"]()]].

Actually, I used 2 gpu GeForce GTX 108. I played with a batch_size, but nothing helped...

What can cause such a problem?

When finetuning, previous networks are kept fixed?

Hi, Simmon!
Thanks for your wonderful code!
But I have some questions now, please give me some advices.
When finetuning, such as use the UnFlowC experiment for first network and UnFlowCS for the second network when training UnFlowCSS, you said that only the final network is trained and any previous networks are kept fixed.
But I can't figure out how you make the previous networks fixed in code, are there any settings in code to make sure the previous networks are fixed?
Please give me some clues, thank you very much!!

Some questions about loss curves from trained model on SYNTHIA

Hi, Simon!
Sorry to bother you again.
This time, I got some problems about loss curves from my own trained model on Synthia dataset. I wish that you can give me some advices, thank you very much,
In details, I used the same hyperparameters as yours in the part of train_synthia in config.ini. Moreover, I added the fb_weight( 0.2 )and occ_weight( 12.4 ) to the train process. Meanwhile, I set the mask_occlusion to fb, set the development to True in config.ini. And the rest of the config.ini is the same as yours.
The loss curves from my own trained model are shown below.

2018-05-03 21-39-51
2018-05-03 21-57-58
2018-05-03 21-58-32
2018-05-03 22-01-30
2018-05-03 22-01-35

I think these loss curves aren't very reasonable, such as loss_combined seems not to be decreased efficiently, smooth_2nd_loss may be wrong, and so on.
And I'm so confused about the real reason causing this problem. I think the only difference between my own train process and yours is that I use a smaller synthia dataset( I set the development to True in config.ini), but I'm not sure if this difference caused the problem.
By the way, I use 4 gpu to train my model, and the loss curves shown above are only
the output of tower 0.
I hope that you can give me some advices to figure the problem out, and can you show some loss curves obtained from your trained model on synthia dataset?
If you can give some loss curves as reference, I think it will be very helpful for me.
Thinks so much in advance, best wishes!

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.