sampepose / flownet2-tf Goto Github PK
View Code? Open in Web Editor NEWFlowNet 2.0: Evolution of Optical Flow Estimation with Deep Networks
License: MIT License
FlowNet 2.0: Evolution of Optical Flow Estimation with Deep Networks
License: MIT License
Hello
I am using tensorflow 1.4 , I was able to build your code successfully no problem and its running but the output optical flow is completely corrupted on the sample images you provide even. Its not like what you provide with the samples at all. What could be the issue?
Thanks
Env:
cuda: 9.0
cudnn: 9.0
tensorflow: 1.8.0
Ubuntu 16.04
I followed the instructions in Wxjwjj's post. Still get errors.
File "/home/charles/Libraries/anaconda2/envs/tensorflow1.2/lib/python2.7/site-packages/tensorflow/python/framework/load_library.py", line 64, in load_op_library
None, None, error_msg, error_code)
tensorflow.python.framework.errors_impl.NotFoundError: src/ops/build/correlation.so: undefined symbol: _ZN10tensorflow16CorrelationGradAERKN5Eigen9GpuDeviceEiiiiiiiiiiiiiiiiiPKfS5_Pf
This is after commenting out -DGOOGLE_CUDA=1. With that, I get the following error during the make process:
48 errors detected in the compilation of "/tmp/tmpxft_000076b3_00000000-7_data_augmentation.cu.cpp1.ii".
Hi!
I wanna convert the result to Gray Scale Image whose number of channel is 1, rather than rgb which conains 3 channels. How can I do this?
/home/ne5/anaconda2/envs/tensorflow/lib/python2.7/site-packages/matplotlib/colors.py:680: MatplotlibDeprecationWarning: The is_string_like function was deprecated in version 2.1.
not cbook.is_string_like(colors[0]):
Traceback (most recent call last):
File "/home/ne5/anaconda2/envs/tensorflow/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/home/ne5/anaconda2/envs/tensorflow/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/ne5/test/flownet2-tf-master/src/flownet_css/train.py", line 10, in
input_a, input_b, flow = load_batch(FLYING_CHAIRS_DATASET_CONFIG, 'sample', net.global_step)
File "src/dataloader.py", line 235, in load_batch
reader_kwargs=reader_kwargs)
TypeError: init() got an unexpected keyword argument 'reader_kwargs'
I have FlowNetS running with its pretrained weights but I was wondering wheter I should normalize the input images in the range (0,1) or in the range (-1,1). As far as I know, I need to normalize the input images in the same range that it was done while training the weights provided.
Any help would be highly appreciated. Thanks in advance!
After successfully compiled the program with tensorflow 1.3.0, I tried running the sample using
python -m src.flownet2.test --input_a data/samples/0img0.ppm --input_b data/samples/0img1.ppm --out ./
However, the program is not producing expected flow result, instead, it produces something as attached, and the result is different for each run.
Has anyone encountered this? Thanks in advance!
I'm using TF 1.3.0 GPU support on Ubuntu 16.04. CUDA = 8.0, cudnn = 6.0
When I try make all finally, I have nsync_cv.h no such file error. I wonder what's causing this. I understand this repository is for TF1.2.1. But I had it working with 1.3 with the previously posted issue. I just changed my ssd and trying the same step once more. But this looks a new issue or very stupid one. I'd appreciate if you can share a bit of insight.
nvcc -g -std=c++11 -Ipython -c "import tensorflow; print(tensorflow.sysconfig.get_include())"
-I"/usr/local/cuda/include" -DGOOGLE_CUDA=1 -D_MWAITXINTRIN_H_INCLUDED -D_FORCE_INLINES -D__STRICT_ANSI__ -D_GLIBCXX_USE_CXX11_ABI=0 -c src/ops/preprocessing/kernels/data_augmentation.cu.cc -x cu -Xcompiler -fPIC -o src/ops/build/data_augmentation.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
In file included from /usr/local/lib/python2.7/dist-packages/tensorflow/include/tensorflow/core/platform/mutex.h:31:0,
from /usr/local/lib/python2.7/dist-packages/tensorflow/include/tensorflow/core/framework/variant.h:31,
from /usr/local/lib/python2.7/dist-packages/tensorflow/include/tensorflow/core/framework/allocator.h:26,
from /usr/local/lib/python2.7/dist-packages/tensorflow/include/tensorflow/core/framework/op_kernel.h:23,
from src/ops/preprocessing/kernels/data_augmentation.h:4,
from src/ops/preprocessing/kernels/data_augmentation.cu.cc:6:
/usr/local/lib/python2.7/dist-packages/tensorflow/include/tensorflow/core/platform/default/mutex.h:25:22: fatal error: nsync_cv.h: No such file or directory
compilation terminated.
Makefile:62: recipe for target 'preprocessing' failed
make: *** [preprocessing] Error 1
from ..net import Mode
ValueError: Attempted relative import in non-package
I can successfully run test.py code in flownet2 in terminal. But when I step through this code in pycharm, there is an error.
Please review code about _flow_warp_grad()
in src/flow_warp.py
:
whether this function should be calling _flow_warp_ops.flow_warp_grad()
, but not _correlation_ops.correlation_grad()
?
Hi,
I got a question about the missing of for loop in the flownet_s train code. I found that input's shape is (8,320,448,3), which means only 8 images are used for training. I wonder if i've missed any detail or i need to add a for loop to fetch batch images during training?
Thanks!
Hello,
First of all, thanks for your efforts. Could you please share data conversion code from original dataset to tfrecords? Thank you very much.
Haichao
Hi,
Thanks a lot for providing the open source code!
How to test a batch?
Highly appreciate your time and help!
I want to see the image after it processed by preprocessing.so ,So I just got the preprocessing.so and compiled.
I read the image by cv2,and send it to the imageprocess function,but it doesn't work.
It successfully invokes the library file(preprocessing.so), When I want to get it by sess.run[image_as,image_bs,flows], It stopped. and gave the Error message.
Error message:
process finished with code 139 (interrupted by signal 11: SIGSEVG)
Have you ever had this problem?
python -m src.flownet2.test --input_a data/samples/0img0.ppm --input_b data/samples/0img1.ppm --out ./
2017-09-13 13:48:11.827500: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-09-13 13:48:11.827522: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-09-13 13:48:11.827526: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-09-13 13:48:11.827529: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-09-13 13:48:11.827533: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/chuchienshu/tensorflowcode/newflownet/flownet2-tf/src/flownet2/test.py", line 51, in <module>
main()
File "/home/chuchienshu/tensorflowcode/newflownet/flownet2-tf/src/flownet2/test.py", line 18, in main
out_path=FLAGS.out,
File "src/net.py", line 68, in test
saver.restore(sess, checkpoint)
File "/home/chuchienshu/.local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1548, in restore
{self.saver_def.filename_tensor_name: save_path})
File "/home/chuchienshu/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 789, in run
run_metadata_ptr)
File "/home/chuchienshu/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 997, in _run
feed_dict_string, options, run_metadata)
File "/home/chuchienshu/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1132, in _do_run
target_list, options, run_metadata)
File "/home/chuchienshu/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1152, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: No OpKernel was registered to support Op 'FlowWarp' with these attrs. Registered devices: [CPU], Registered kernels:
device='GPU'
[[Node: FlowNet2/FlowWarp = FlowWarp[](ExpandDims_1, FlowNet2/FlowNetSD/ResizeBilinear)]]
Caused by op u'FlowNet2/FlowWarp', defined at:
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/chuchienshu/tensorflowcode/newflownet/flownet2-tf/src/flownet2/test.py", line 51, in <module>
main()
File "/home/chuchienshu/tensorflowcode/newflownet/flownet2-tf/src/flownet2/test.py", line 18, in main
out_path=FLAGS.out,
File "src/net.py", line 62, in test
predictions = self.model(inputs, training_schedule)
File "src/flownet2/flownet2.py", line 33, in model
flow_warp_sd = flow_warp(inputs['input_b'], net_sd_predictions['flow'])
File "src/flow_warp.py", line 8, in flow_warp
return _flow_warp_ops.flow_warp(image, flow)
File "<string>", line 30, in flow_warp
File "/home/chuchienshu/.local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 767, in apply_op
op_def=op_def)
File "/home/chuchienshu/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2506, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/home/chuchienshu/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1269, in __init__
self._traceback = _extract_stack()
InvalidArgumentError (see above for traceback): No OpKernel was registered to support Op 'FlowWarp' with these attrs. Registered devices: [CPU], Registered kernels:
device='GPU'
[[Node: FlowNet2/FlowWarp = FlowWarp[](ExpandDims_1, FlowNet2/FlowNetSD/ResizeBilinear)]]
The version of tensorflow is 1.2.0.thanks a lot!
Hi Sam,
Thanks a lot for providing the open-source code.
How to use your code to fine tune Sentel dataset?
Highly appreciate your time and help!
Hello sir,
First of all, thank you very much for your codes which helped me a lot to understand FlowNet2, but when I try to train your model, I found often that the weights and loss become nan. Have you ever encountered this strange problem and if so, how did you solve this problem ? Thank you very much for your attention.
Yours sincerely,
Jinglei SHI
when i run the python -m src.flownet2.test --input_a data/samples/0img0.ppm --input_b data/samples/0img1.ppm --out flow_generate
the problem is :
OutOfRangeError (see above for traceback): Read less bytes than requested
[[Node: save/RestoreV2_130 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_arg_save/Const_0_0, save/RestoreV2_130/tensor_names, save/RestoreV2_130/shape_and_slices)]]
[[Node: save/RestoreV2_176/_37 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/gpu:0", send_device="/job:localhost/replica:0/task:0/cpu:0", send_device_incarnation=1, tensor_name="edge_434_save/RestoreV2_176", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:0"]]
i don't know how to solve it?
on mint18,cuda8.0,python2.7,with gpu
Has anyone meet this problem before?
****@*******:~/Documents/flownet2-tf$ python -m src.flownet2.test --input_a data/samples/0img0.ppm --input_b data/samples/0img1.ppm --out ./
Segmentation fault (core dumped)
Hi,
Sampepose,
Thanks for your great job. While I running the code, I found that it's very difficult for the model with augmentation process to converge. The training loss and test loss is very large(about 50). And if I block out the preprocess code, the model converge very fast, the training loss is about 2. Then I realize that if I set the 'scale' option in dataset_config to be True, the tensorboard can show correct image, while if I set it to be False, the tensorboard failed to show correct image.
What's more, if I choose to only do the 'translate', 'rotate' and 'zoom' operations, no matter how the 'scale' option is, the tensorboard can show the correct image.
So, I'm wondering if there is anything about the augmentation process should I pay attention to? And would you like put your converging curve here, so can I make sure I'm doing the same training as yours.
My system is ubuntu14.04, and gpu is TitanXP, and I compile your code with gpu compatibility as sm=61.
Expecting your reply. Thanks in advance!
Would be happy about some hint, if a good process exists.
FlowNet2/
FlowNet2/flownet-2.ckpt-0.index
FlowNet2/flownet-2.ckpt-0.data-00000-of-00001
tar: Unexpected EOF in archive
In my distribution, the example works well:
python -m src.flownet2.test --input_a data/samples/0img0.ppm --input_b data/samples/0img1.ppm --out ./
But when I tried to use my own data, there was a unmatching problem in tf.concat() between conv5
and deconv5
. I pasted the error logs below:
> $ python -m src.flownet2.test --input_a data/examples/00000.jpg --input_b data/examples/00001.jpg --out ./
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/workspace/playground/flownet2-tf/src/flownet2/test.py", line 78, in <module>
main()
File "/home/workspace/playground/flownet2-tf/src/flownet2/test.py", line 39, in main
out_path=FLAGS.out,
File "src/net.py", line 63, in test
predictions = self.model(inputs, training_schedule)
File "src/flownet2/flownet2.py", line 22, in model
net_css_predictions = self.net_css.model(inputs, training_schedule, trainable=False)
File "src/flownet_css/flownet_css.py", line 18, in model
net_cs_predictions = self.net_cs.model(inputs, training_schedule, trainable=False)
File "src/flownet_cs/flownet_cs.py", line 18, in model
net_c_predictions = self.net_c.model(inputs, training_schedule, trainable=False)
File "src/flownet_c/flownet_c.py", line 70, in model
concat5 = tf.concat([conv5_1, deconv5, upsample_flow6to5], axis=3)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 1048, in concat
name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_array_ops.py", line 495, in _concat_v2
name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 767, in apply_op
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2508, in create_op
set_shapes_for_outputs(ret)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1873, in set_shapes_for_outputs
shapes = shape_func(op)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1823, 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 610, in call_cpp_shape_fn
debug_python_shape_fn, require_shape_fn)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/common_shapes.py", line 676, in _call_cpp_shape_fn_impl
raise ValueError(err.message)
ValueError: Dimension 1 in both shapes must be equal, but are 15 and 16 for 'FlowNet2/FlowNetCSS/FlowNetCS/FlowNetC/concat_1' (op: 'ConcatV2') with input shapes: [1,15,27,512], [1,16,28,512], [1,16,28,2], [] and with computed input tensors: input[3] = <3>.
The shape of input images are the same, and I pasted the output of command file below:
> $ file data/examples/*
data/examples/00000.jpg: JPEG image data, JFIF standard 1.01, resolution (DPCM), density 94x94, segment length 16, baseline, precision 8, 854x480, frames 3
data/examples/00001.jpg: JPEG image data, JFIF standard 1.01, resolution (DPCM), density 94x94, segment length 16, baseline, precision 8, 854x480, frames 3
What's more, I tried to use the same image as --input_a
and --input_b
, the error still occurs.
Hi, thanks for sharing this code. Can you also share the intermedia npy file of the model weights? Since installing Caffe on my cluster is a bit tricky, I wanna have the npy to feed my TensorFlow model.
Thank you!
Hello,
My setup is python 3.5.2 , TF 1.8.0 and Cuda 9.0.
I have successfully compiled flownet in order to use the correlation layer.
However, when loading the correlation.so, I get the following error :
from object_detection.utils.correlation import correlation
ImportError: /data/tensorflow/models/research/object_detection/utils/correlation.so: undefined symbol: _ZTIN10tensorflow8OpKernelE
After looking this up online, i found more than a couple of people suggesting this fix :
https://www.tensorflow.org/versions/master/extend/adding_an_op#compile_the_op_using_your_system_compiler_tensorflow_binary_installation
( adding -ltensorflow_framework to the CGPU Flags)
I have successfully compiled (make all) flownet with the added flag, but i still get the same error. This is the output of my compilation process (only included last several lines, but no errors occur, as you can see, and the flag is in place) :
g++ -g -std=c++11 -Ipython -c "import tensorflow; print(tensorflow.sysconfig.get_include())"
-I"/usr/local/cuda/include" -DGOOGLE_CUDA=1 -D_MWAITXINTRIN_H_INCLUDED -D_FORCE_INLINES -D__STRICT_ANSI__ -D_GLIBCXX_USE_CXX11_ABI=0 "src/ops/downsample/downsample_kernel.cc" "src/ops/downsample/downsample_op.cc" src/ops/build/downsample_kernel_gpu.o -pthread -shared -fPIC -L/usr/local/cuda/lib -L/usr/local/cuda/lib64 -lcudart -L/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow -ltensorflow_framework -o src/ops/build/downsample.so
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/h5py/init.py:34: 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
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
nvcc -g -std=c++11 -Ipython -c "import tensorflow; print(tensorflow.sysconfig.get_include())"
-I"/usr/local/cuda/include" -DGOOGLE_CUDA=1 -D_MWAITXINTRIN_H_INCLUDED -D_FORCE_INLINES -D__STRICT_ANSI -D_GLIBCXX_USE_CXX11_ABI=0 -c src/ops/correlation/correlation_kernel.cu.cc -x cu -Xcompiler -fPIC --expt-relaxed-constexpr -o src/ops/build/correlation_kernel_gpu.o
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/h5py/init.py:34: 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
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(57): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(304): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(305): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(57): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(304): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(305): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/generated_message_reflection.h(685): warning: variable "unused" was set but never used
nvcc -g -std=c++11 -Ipython -c "import tensorflow; print(tensorflow.sysconfig.get_include())"
-I"/usr/local/cuda/include" -DGOOGLE_CUDA=1 -D_MWAITXINTRIN_H_INCLUDED -D_FORCE_INLINES -D__STRICT_ANSI__ -D_GLIBCXX_USE_CXX11_ABI=0 -c src/ops/correlation/correlation_grad_kernel.cu.cc -x cu -Xcompiler -fPIC --expt-relaxed-constexpr -o src/ops/build/correlation_grad_kernel_gpu.o
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/h5py/init.py:34: 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
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(57): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(304): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(305): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(57): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(304): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(305): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/generated_message_reflection.h(685): warning: variable "unused" was set but never used
nvcc -g -std=c++11 -Ipython -c "import tensorflow; print(tensorflow.sysconfig.get_include())"
-I"/usr/local/cuda/include" -DGOOGLE_CUDA=1 -D_MWAITXINTRIN_H_INCLUDED -D_FORCE_INLINES -D__STRICT_ANSI__ -D_GLIBCXX_USE_CXX11_ABI=0 -c src/ops/correlation/pad.cu.cc -x cu -Xcompiler -fPIC --expt-relaxed-constexpr -o src/ops/build/correlation_pad_gpu.o
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/h5py/init.py:34: 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
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(57): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(304): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(305): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(57): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(304): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(305): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/generated_message_reflection.h(685): warning: variable "unused" was set but never used
g++ -g -std=c++11 -Ipython -c "import tensorflow; print(tensorflow.sysconfig.get_include())"
-I"/usr/local/cuda/include" -DGOOGLE_CUDA=1 -D_MWAITXINTRIN_H_INCLUDED -D_FORCE_INLINES -D__STRICT_ANSI__ -D_GLIBCXX_USE_CXX11_ABI=0 "src/ops/correlation/correlation_kernel.cc" "src/ops/correlation/correlation_grad_kernel.cc" "src/ops/correlation/correlation_op.cc" src/ops/build/correlation_kernel_gpu.o src/ops/build/correlation_grad_kernel_gpu.o src/ops/build/correlation_pad_gpu.o -pthread -shared -fPIC -L/usr/local/cuda/lib -L/usr/local/cuda/lib64 -lcudart -L/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow -ltensorflow_framework -o src/ops/build/correlation.so #
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/h5py/init.py:34: 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
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
nvcc -g -std=c++11 -Ipython -c "import tensorflow; print(tensorflow.sysconfig.get_include())"
-I"/usr/local/cuda/include" -DGOOGLE_CUDA=1 -D_MWAITXINTRIN_H_INCLUDED -D_FORCE_INLINES -D__STRICT_ANSI -D_GLIBCXX_USE_CXX11_ABI=0 -c "src/ops/flow_warp/flow_warp.cu.cc" -x cu -Xcompiler -fPIC --expt-relaxed-constexpr -o "src/ops/build/flow_warp_gpu.o"
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/h5py/init.py:34: 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
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(57): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(304): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(305): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(57): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(304): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/arena_impl.h(305): warning: integer conversion resulted in a change of sign
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow/include/google/protobuf/generated_message_reflection.h(685): warning: variable "unused" was set but never used
nvcc -g -std=c++11 -Ipython -c "import tensorflow; print(tensorflow.sysconfig.get_include())"
-I"/usr/local/cuda/include" -DGOOGLE_CUDA=1 -D_MWAITXINTRIN_H_INCLUDED -D_FORCE_INLINES -D__STRICT_ANSI__ -D_GLIBCXX_USE_CXX11_ABI=0 -c "src/ops/flow_warp/flow_warp_grad.cu.cc" -x cu -Xcompiler -fPIC --expt-relaxed-constexpr -o "src/ops/build/flow_warp_grad_gpu.o"
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/h5py/init.py:34: 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
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
src/ops/flow_warp/flow_warp_grad.cu.cc(59): warning: variable "ch_off" was declared but never referenced
src/ops/flow_warp/flow_warp_grad.cu.cc(59): warning: variable "ch_off" was declared but never referenced
g++ -g -std=c++11 -Ipython -c "import tensorflow; print(tensorflow.sysconfig.get_include())"
-I"/usr/local/cuda/include" -DGOOGLE_CUDA=1 -D_MWAITXINTRIN_H_INCLUDED -D_FORCE_INLINES -D__STRICT_ANSI__ -D_GLIBCXX_USE_CXX11_ABI=0 "src/ops/flow_warp/flow_warp_op.cc" "src/ops/flow_warp/flow_warp.cc" "src/ops/flow_warp/flow_warp_grad.cc" "src/ops/build/flow_warp_gpu.o" "src/ops/build/flow_warp_grad_gpu.o" -pthread -shared -fPIC -L/usr/local/cuda/lib -L/usr/local/cuda/lib64 -lcudart -L/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/tensorflow -ltensorflow_framework -o "src/ops/build/flow_warp.so"
/home/andi/miniconda3/envs/tf18/lib/python3.5/site-packages/h5py/init.py:34: 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
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
Please help :"> This is very important to me, as I am trying hard to implement a recent paper with great results. Changing the TF and CUDA versions would probably be a solution, but i-m only considering that as my last option.
Guys, fingers crossed 👍
from ..dataloader import load_batch
ValueError: Attempted relative import in non-package
When I try to train the model, the question is Attempted relative import in non-package
Hello, I'm appreciate your work!! But when I replicate your code, I have met a error: fatal error: cuda/cuda_config.h: No such file or directory, while I run 'make all'.
How could I fix the issue?
Thanks!
Besides, the details of error are listed bellow.
In file included from /home/server109/anaconda2/lib/python2.7/site-packages/tensorflow/include/tensorflow/core/platform/default/stream_executor.h:26:0, from /home/server109/anaconda2/lib/python2.7/site-packages/tensorflow/include/tensorflow/core/platform/stream_executor.h:24, from /home/server109/anaconda2/lib/python2.7/site-packages/tensorflow/include/tensorflow/core/util/cuda_kernel_helper.h:26, from src/ops/preprocessing/kernels/data_augmentation.cu.cc:7: /home/server109/anaconda2/lib/python2.7/site-packages/tensorflow/include/tensorflow/stream_executor/dso_loader.h:32:30: fatal error: cuda/cuda_config.h: No such file or directory compilation terminated. Makefile:62: recipe for target 'preprocessing' failed make: *** [preprocessing] Error 1 make: *** Waiting for unfinished jobs.... In file included from /home/server109/anaconda2/lib/python2.7/site-packages/tensorflow/include/tensorflow/core/platform/default/stream_executor.h:26:0, from /home/server109/anaconda2/lib/python2.7/site-packages/tensorflow/include/tensorflow/core/platform/stream_executor.h:24, from /home/server109/anaconda2/lib/python2.7/site-packages/tensorflow/include/tensorflow/core/util/cuda_kernel_helper.h:26, from src/ops/flow_warp/flow_warp.cu.cc:13: /home/server109/anaconda2/lib/python2.7/site-packages/tensorflow/include/tensorflow/stream_executor/dso_loader.h:32:30: fatal error: cuda/cuda_config.h: No such file or directory compilation terminated. Makefile:77: recipe for target 'flowwarp' failed make: *** [flowwarp] Error 1 In file included from /home/server109/anaconda2/lib/python2.7/site-packages/tensorflow/include/tensorflow/core/platform/default/stream_executor.h:26:0, from /home/server109/anaconda2/lib/python2.7/site-packages/tensorflow/include/tensorflow/core/platform/stream_executor.h:24, from /home/server109/anaconda2/lib/python2.7/site-packages/tensorflow/include/tensorflow/core/util/cuda_kernel_helper.h:26, from src/ops/downsample/downsample_kernel_gpu.cu.cc:13: /home/server109/anaconda2/lib/python2.7/site-packages/tensorflow/include/tensorflow/stream_executor/dso_loader.h:32:30: fatal error: cuda/cuda_config.h: No such file or directory compilation terminated. Makefile:67: recipe for target 'downsample' failed make: *** [downsample] Error 1 In file included from /home/server109/anaconda2/lib/python2.7/site-packages/tensorflow/include/tensorflow/core/platform/default/stream_executor.h:26:0, from /home/server109/anaconda2/lib/python2.7/site-packages/tensorflow/include/tensorflow/core/platform/stream_executor.h:24, from /home/server109/anaconda2/lib/python2.7/site-packages/tensorflow/include/tensorflow/core/util/cuda_kernel_helper.h:26, from src/ops/correlation/correlation_kernel.cu.cc:16: /home/server109/anaconda2/lib/python2.7/site-packages/tensorflow/include/tensorflow/stream_executor/dso_loader.h:32:30: fatal error: cuda/cuda_config.h: No such file or directory compilation terminated. Makefile:71: recipe for target 'correlation' failed make: *** [correlation] Error 1
When reading the code about FlowNet_CS, I found that the train()
in net.py call loss()
function, which only call self.net_s.loss
, without self.net_c.loss()
. So the self.net_c
CANNOT be trained when training the FlowNet_CS, the code use trained FlowNet_C model as self.net_c
for FlowNet_CS. Right?
You kown that the number of dataset with flow is very small, so i want the train the net with warped the images, such as:
#... code about the flownet_c net
""" END: Refinement Network """
flow = predict_flow2 * 20.0
flow = tf.image.resize_bilinear(flow, tf.stack([height, width]), align_corners=True)
warped = flow_warp(inputs['input_b'], flow)
return {'input_b': warped, 'input_a': inputs['input_a']}
def loss(self, flow, predictions):
tf.losses.add_loss(average_endpoint_error(predictions['input_a'], predictions['input_b']))
return tf.losses.get_total_loss()
This code need to use _flow_warp_grad(), but I got errors when running it:
...
tensorflow.python.framework.errors_impl.InternalError: Missing 1-th output from gradients/FlowNetC/FlowWarp_grad/FlowWarpGrad = FlowWarpGrad[_device="/job:localhost/replica:0/task:0/gpu:0"](ResizeBicubic_1/_523, FlowNetC/ResizeBilinear, gradients/average_endpoint_error/Sub_grad/tuple/control_dependency)
[[Node: train_op/control_dependency/_579 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name="edge_4895_train_op/control_dependency", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]()]]
So, does flow_warp allow a backward pass while training? or any problem in my code ? Thanks!
Hi,
Has anyone tried to compile on Windows?
I just want to test on a couple of images.
Thanks
While running the given test command, I'm getting this error:
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/data/anuj/motion/flownet2-tf/src/flownet2/test.py", line 51, in
main()
File "/data/anuj/motion/flownet2-tf/src/flownet2/test.py", line 18, in main
out_path=FLAGS.out,
File "src/net.py", line 68, in test
saver.restore(sess, checkpoint)
File "/home/anuj/.local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1548, in restore
{self.saver_def.filename_tensor_name: save_path})
File "/home/anuj/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 789, in run
run_metadata_ptr)
File "/home/anuj/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 997, in _run
feed_dict_string, options, run_metadata)
File "/home/anuj/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1132, in _do_run
target_list, options, run_metadata)
File "/home/anuj/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1152, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: No OpKernel was registered to support Op 'FlowWarp' with these attrs. Registered devices: [CPU], Registered kernels:
device='GPU'
[[Node: FlowNet2/FlowWarp = FlowWarp[](ExpandDims_1, FlowNet2/FlowNetSD/ResizeBilinear)]]
If I use the network flownet2-s or flownet2-sd, it works fine.
I'm using TF 1.2.0, CUDA 8.0, CuDNN 7 on Ubuntu 16.04.
Hi Sam,
great job on the TF implementation! We would like to make use of (some of) your code and the ported models, but there is currently no license on this repository. If you are ok with us using it, could I ask you to add a license or give us permission to do so? :)
Thanks,
Nikolaus
in test.py file has code line 11
tf.resource_loader.get_path_to_datafile("./src/ops/build/preprocessing.so"))
but in the ./src/ops/build/ directory has no this file"preprocessing.so"
$ python test.py
Traceback (most recent call last):
File "test.py", line 11, in
tf.resource_loader.get_path_to_datafile("./src/ops/build/preprocessing.so"))
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/load_library.py", line 56, in load_op_library
lib_handle = py_tf.TF_LoadLibrary(library_filename, status)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/errors_impl.py", line 473, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: ./src/ops/build/preprocessing.so: cannot open shared object file: No such file or directory
because i don't use "make" to compile the project.But after I enter "make"
$ make
nvcc -g -std=c++11 -Ipython -c "import tensorflow; print(tensorflow.sysconfig.get_include())"
-I"/usr/local/cuda/include" -DGOOGLE_CUDA=1 -D_MWAITXINTRIN_H_INCLUDED -D_FORCE_INLINES -D__STRICT_ANSI__ -D_GLIBCXX_USE_CXX11_ABI=0 -c src/ops/preprocessing/kernels/data_augmentation.cu.cc -x cu -Xcompiler -fPIC -o src/ops/build/data_augmentation.o
nvcc fatal : Unknown option 'std'
make: *** [preprocessing] 错误 255
How to solve this question? Thank you very much.
File "/home/tgy/inpainting-3d-flownet2/main.py", line 45, in
switchFLAGS.mode
File "/home/tgy/inpainting-3d-flownet2/main.py", line 18, in train_or_finetune
sw.train()
File "/home/tgy/inpainting-3d-flownet2/solver.py", line 46, in train
self._train()
File "/home/tgy/inpainting-3d-flownet2/solver.py", line 134, in _train
] = self.sess.run(ops, feed_dict=feed_dict)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 789, in run
run_metadata_ptr)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 997, in _run
feed_dict_string, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1132, in _do_run
target_list, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1152, in _do_call
raise type(e)(node_def, op, message)
InternalError: Missing 1-th output from gradients_5/FlowNet2/FlowWarp_grad/FlowWarpGrad = FlowWarpGrad[_device="/job:localhost/replica:0/task:0/gpu:0"](concat_21, FlowNet2/FlowNetSD/ResizeBilinear, gradients_5/FlowNet2/sub_grad/tuple/control_dependency_1)
After Installing all library it shows this error
fatal error: cuda/include/cuda.h: No such file or directory
Dear all,
I have an issue trying to compile the code with tensorflow 1.4. I already solve the problem of cuda_config.h missing, looking at a solved issue.
Here is the output of make all:
make all nvcc -g -std=c++11 -I
python -c "import tensorflow; print(tensorflow.sysconfig.get_include())"` -I"/usr/local/cuda/include" -DGOOGLE_CUDA=1 -D_MWAITXINTRIN_H_INCLUDED -D_FORCE_INLINES -D__STRICT_ANSI__ -D_GLIBCXX_USE_CXX11_ABI=0 -c -gencode=arch=compute_30,code=sm_30 src/ops/preprocessing/kernels/data_augmentation.cu.cc -x cu -Xcompiler -fPIC -o src/ops/build/data_augmentation.o
/usr/local/lib/python2.7/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../../../Eigen/src/Core/MathFunctions.h(1265): warning: calling a constexpr host function("real") from a host device function("abs") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
/usr/local/lib/python2.7/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../../../Eigen/src/Core/MathFunctions.h(1265): warning: calling a constexpr host function("imag") from a host device function("abs") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
/usr/local/lib/python2.7/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../../../Eigen/src/Core/MathFunctions.h(1265): warning: calling a constexpr host function from a host device function is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
/usr/local/lib/python2.7/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../../../Eigen/src/Core/MathFunctions.h(1265): warning: calling a constexpr host function from a host device function is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
/usr/local/lib/python2.7/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../../../Eigen/src/Core/MathFunctions.h(1270): warning: calling a constexpr host function("real") from a host device function("abs") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
/usr/local/lib/python2.7/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../../../Eigen/src/Core/MathFunctions.h(1270): warning: calling a constexpr host function("imag") from a host device function("abs") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
/usr/local/lib/python2.7/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../../../Eigen/src/Core/MathFunctions.h(1270): warning: calling a constexpr host function from a host device function is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
/usr/local/lib/python2.7/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/../../../Eigen/src/Core/MathFunctions.h(1270): warning: calling a constexpr host function from a host device function is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
/usr/local/lib/python2.7/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/src/Tensor/TensorRandom.h(133): warning: calling a constexpr host function from a host device function is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
/usr/local/lib/python2.7/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/src/Tensor/TensorRandom.h(138): warning: calling a constexpr host function from a host device function is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
/usr/local/lib/python2.7/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/src/Tensor/TensorRandom.h(208): warning: calling a constexpr host function from a host device function is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
/usr/local/lib/python2.7/dist-packages/tensorflow/include/unsupported/Eigen/CXX11/src/Tensor/TensorRandom.h(213): warning: calling a constexpr host function from a host device function is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
/usr/local/lib/python2.7/dist-packages/tensorflow/include/google/protobuf/arena_impl.h(52): warning: integer conversion resulted in a change of sign
/usr/local/lib/python2.7/dist-packages/tensorflow/include/google/protobuf/arena_impl.h(147): warning: integer conversion resulted in a change of sign
/usr/local/lib/python2.7/dist-packages/tensorflow/include/tensorflow/core/util/cuda_kernel_helper.h(572): error: calling a constexpr host function("real") from a device function("CudaAtomicSub") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
/usr/local/lib/python2.7/dist-packages/tensorflow/include/tensorflow/core/util/cuda_kernel_helper.h(572): error: calling a constexpr host function("imag") from a device function("CudaAtomicSub") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
/usr/local/lib/python2.7/dist-packages/tensorflow/include/tensorflow/core/util/cuda_kernel_helper.h(577): error: calling a constexpr host function("real") from a device function("CudaAtomicSub") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
/usr/local/lib/python2.7/dist-packages/tensorflow/include/tensorflow/core/util/cuda_kernel_helper.h(577): error: calling a constexpr host function("imag") from a device function("CudaAtomicSub") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
4 errors detected in the compilation of "/tmp/tmpxft_000009d2_00000000-7_data_augmentation.cu.cpp1.ii".
Makefile:63: recipe for target 'preprocessing' failed
make: *** [preprocessing] Error 2`
Thank you very much for your excellent work! I just wonder how we can port a caffe model to Tensorflow (because I want to port another caffe model to Tensorflow)
Did you train FlowNet2 from the scratch, or use the original caffe model and port it?
1.When I train the model(anyone) according to README , I found it's very difficult for the model with data augmentation to converge, and the model without data augmentation converged well.
From tensorboard visualization, it seems that the model can only learn background information with data augmentation, and the LOSS is about 40.
I am confused is there anything I should pay attention to and can anyone show me the convergence curve?
2.Using the checkpoints offered by the author, the result on FlyingChair is good.
But when testing the model in SINTEL dataset, I found the error is extremely large which is about 14, and can’t reach the paper’s result which is about 4.
Specifically, the resolution of SINTEL image is 1024x436, so I resized it to 1024x448 to adapt the model. I’m not sure whether it’s a problem.
Anyone have any better solution?
Thanks a lot!
Hi,
Thanks for your awesome code. It runs extremely well on the GPU but I was wondering if it can be run on CPU?
Thanks,
Nitin
dell@dell:~/device/flownet2-tf-master$ python -m src.flownet2.test --input_a data/samples/0img0.ppm --input_b data/samples/0img1.ppm --out ./
/home/dell/anaconda2/lib/python2.7/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float
to np.floating
is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type
.
from ._conv import register_converters as _register_converters
Traceback (most recent call last):
File "/home/dell/anaconda2/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/home/dell/anaconda2/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/dell/device/flownet2-tf-master/src/flownet2/test.py", line 4, in
from flownet2 import FlowNet2
File "src/flownet2/flownet2.py", line 2, in
from flownet_css import FlowNetCSS
File "src/flownet2/flownet_css.py", line 2, in
from flownet_cs import FlowNetCS
File "src/flownet2/flownet_cs.py", line 2, in
from flownet_c import FlowNetC
ImportError: cannot import name FlowNetC
I'm preparing the training data by converting images to tfrecord file. Then i replaced the oringinal tfrecord file "fc_sampe.tfrecord" with it. After that i run the command line 'python -m src.flownet2.train' to train the model, but i got the error messages:
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/jixi/test/flownet2-tf/src/flownet2/train.py", line 24, in
'./checkpoints/FlowNetSD/flownet-SD.ckpt-0': ('FlowNet2/FlowNetSD', 'FlowNet2')
File "/home/jixi/test/flownet2-tf/src/net.py", line 154, in train
number_of_steps=training_schedule['max_iter']
File "/usr/lib/python3.6/site-packages/tensorflow/contrib/slim/python/slim/learning.py", line 784, in train
ignore_live_threads=ignore_live_threads)
File "/usr/lib/python3.6/site-packages/tensorflow/python/training/supervisor.py", line 828, in stop
ignore_live_threads=ignore_live_threads)
File "/usr/lib/python3.6/site-packages/tensorflow/python/training/coordinator.py", line 389, in join
six.reraise(*self._exc_info_to_raise)
File "/usr/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/lib/python3.6/site-packages/tensorflow/python/training/queue_runner_impl.py", line 252, in _run
enqueue_callable()
File "/usr/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1244, in _single_operation_run
self._call_tf_sessionrun(None, {}, [], target_list, None)
File "/usr/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1409, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.DataLossError: inflate() failed with error -3: incorrect header check
[[Node: load_batch/parallel_read/ReaderReadV2_2 = ReaderReadV2[_device="/job:localhost/replica:0/task:0/device:CPU:0"](load_batch/parallel_read/TFRecordReaderV2_2, load_batch/parallel_read/filenames)]]
and here is my code to generate the tfrecord data:
def _bytes_feature(value):
return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value]))
def _int64_feature(value):
return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))
tfrecords_filename = 'FlyingChairs_test.tfrecords'
tfrecords_path = 'tfrecords/'
writer = tf.python_io.TFRecordWriter(tfrecords_path+tfrecords_filename)
original_images = []
for img_path_1, img_path_2, flow_path in filename_pairs:
img_1 = io.imread(img_path_1).astype('float64')
img_2 = io.imread(img_path_2).astype('float64')
flow = fe.readFlo(flow_path)
original_images.append((img_1, img_2, flow))
img_1_raw = img_1.tostring()
img_2_raw = img_2.tostring()
flow_raw = flow.tostring()
example = tf.train.Example(features=tf.train.Features(feature={
'image_a': _bytes_feature(img_1_raw),
'image_b': _bytes_feature(img_2_raw),
'flow': _bytes_feature(flow_raw)}))
writer.write(example.SerializeToString())
writer.close()
can anyone help me how to generate the training data correctly?
when I run python -m src.flownet_s.train
,I get print info as below.
2017-09-26 07:49:25.716966: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-09-26 07:49:25.716993: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-09-26 07:49:25.716998: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-09-26 07:49:25.717002: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-09-26 07:49:25.717006: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
2017-09-26 07:49:26.007158: I tensorflow/core/common_runtime/gpu/gpu_device.cc:940] Found device 0 with properties:
name: TITAN Xp
major: 6 minor: 1 memoryClockRate (GHz) 1.582
pciBusID 0000:02:00.0
Total memory: 11.90GiB
Free memory: 11.74GiB
2017-09-26 07:49:26.007182: I tensorflow/core/common_runtime/gpu/gpu_device.cc:961] DMA: 0
2017-09-26 07:49:26.007186: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] 0: Y
2017-09-26 07:49:26.007192: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Creating TensorFlow device (/gpu:0) -> (device: 0, name: TITAN Xp, pci bus id: 0000:02:00.0)
Segmentation fault (core dumped)
os information:
Ubuntu 16.04
cuda 8.0
tensorflow-gpu 1.2.1
Python 2.7.12
Anyone helps?Thanks a lot.
python3 -m src.flownet2.test --input_a data/samples/0img0.ppm --input_b data/samples/0img1.ppm --out ./
Traceback (most recent call last):
File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/chuchienshu/tensorflowcode/newflownet/flownet2-tf/src/flownet2/test.py", line 4, in <module>
from .flownet2 import FlowNet2
File "/home/chuchienshu/tensorflowcode/newflownet/flownet2-tf/src/flownet2/flownet2.py", line 2, in <module>
from ..flownet_css.flownet_css import FlowNetCSS
File "/home/chuchienshu/tensorflowcode/newflownet/flownet2-tf/src/flownet_css/flownet_css.py", line 2, in <module>
from ..flownet_cs.flownet_cs import FlowNetCS
File "/home/chuchienshu/tensorflowcode/newflownet/flownet2-tf/src/flownet_cs/flownet_cs.py", line 2, in <module>
from ..flownet_c.flownet_c import FlowNetC
File "/home/chuchienshu/tensorflowcode/newflownet/flownet2-tf/src/flownet_c/flownet_c.py", line 3, in <module>
from ..correlation import correlation
File "/home/chuchienshu/tensorflowcode/newflownet/flownet2-tf/src/correlation.py", line 4, in <module>
tf.resource_loader.get_path_to_datafile("./ops/build/correlation.so"))
File "/home/chuchienshu/.local/lib/python3.5/site-packages/tensorflow/python/framework/load_library.py", line 64, in load_op_library
None, None, error_msg, error_code)
tensorflow.python.framework.errors_impl.NotFoundError: /home/chuchienshu/tensorflowcode/newflownet/flownet2-tf/src/./ops/build/correlation.so: undefined symbol: _ZN10tensorflow15shape_inference16InferenceContext8WithRankENS0_11ShapeHandleExPS2_
@sampepose ,hi. There is an error occurred when I train the flownet_s just using the command :python -m src.flownet_s.train
. Looking forward to your reply!
line 342 in src/ops/preprocessing/kernels/augmentation_base.cc:
y2 = sin(coeff.angle()) * x1 + sin(coeff.angle()) * y1;
I suppose it should be:
y2 = sin(coeff.angle()) * x1 + cos(coeff.angle()) * y1;
Enev:
cuda: 9.0
cudnn: 9.0
tensorflow: 1.8.0
Ubuntu16.04
Makefile modified
CUDA_HOME := /home/ <user name>/wuxj/cuda-9.0
CGPUFLAGS: add your tensorflow library
eg: -L /home/<user name>/.local/lib/python2.7/site-packages/tensorflow -ltensorflow_framework
Headers modified (from error)
vi cuda_device_functions.h / cuda_launch_config.h / cuda_kernel_helper.h
and modify the the headers
eg:
#include "cuda/include/cuda_fp16.h" to #include "cuda_fp16.h"
Thank you very much for your excellent work! I met some problem when i use the dataset to training the model;
the output message as:
/flownet2-tf$ python -m src.flownet_s.train
2017-10-31 11:24:27.425738: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-10-31 11:24:27.425771: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-10-31 11:24:27.425793: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-10-31 11:24:27.425811: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-10-31 11:24:27.425829: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX512F instructions, but these are available on your machine and could speed up CPU computations.
2017-10-31 11:24:27.425847: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
2017-10-31 11:24:27.646726: I tensorflow/core/common_runtime/gpu/gpu_device.cc:940] Found device 0 with properties:
name: Quadro P5000
major: 6 minor: 1 memoryClockRate (GHz) 1.7335
pciBusID 0000:65:00.0
Total memory: 15.89GiB
Free memory: 15.47GiB
2017-10-31 11:24:27.646762: I tensorflow/core/common_runtime/gpu/gpu_device.cc:961] DMA: 0
2017-10-31 11:24:27.646780: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] 0: Y
2017-10-31 11:24:27.646793: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Creating TensorFlow device (/gpu:0) -> (device: 0, name: Quadro P5000, pci bus id: 0000:65:00.0)
Killed
Although it generate a model, I thought the process of training was killed, and it not finished training the whole dataset.
I tried to reduce the BATCH_SIZE to 2, but the result was same, was killed.
Did you met this situation, and how do I fix it?
Wishing for your reply, and thank you very much for your contribution!
This program can only accept 512X384 resolution, other resolutions will be wrong,How to make it accept any resolution picture
Hello,
Very nice work, and thanks for the code. I just wanted to know about the datasets being used for training the pre-trained model.
or particularly I wanted to know that if you used KITTI training databases during training the model??
Thanks and Regards,
Vijay
nvcc -g -std=c++11 -Ipython -c "import tensorflow; print(tensorflow.sysconfig.get_include())"
-I"/usr/local/cuda-8.0/.." -DGOOGLE_CUDA=1 -D_MWAITXINTRIN_H_INCLUDED -D_FORCE_INLINES -D__STRICT_ANSI__ -D_GLIBCXX_USE_CXX11_ABI=0 -c src/ops/preprocessing/kernels/data_augmentation.cu.cc -x cu -Xcompiler -fPIC -o src/ops/build/data_augmentation.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
In file included from /home/chirag/.local/lib/python2.7/site-packages/tensorflow/include/tensorflow/core/platform/stream_executor.h:26:0,
from /home/chirag/.local/lib/python2.7/site-packages/tensorflow/include/tensorflow/core/util/cuda_kernel_helper.h:27,
from src/ops/preprocessing/kernels/data_augmentation.cu.cc:7:
/home/chirag/.local/lib/python2.7/site-packages/tensorflow/include/tensorflow/stream_executor/dso_loader.h:32:30: fatal error: cuda/cuda_config.h: No such file or directory
compilation terminated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.