Giter Site home page Giter Site logo

simonselg / lmbspecialops Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lmb-freiburg/lmbspecialops

2.0 2.0 0.0 154 KB

A collection of tensorflow ops

License: GNU General Public License v3.0

CMake 1.47% Python 14.16% C++ 45.61% Cuda 38.75%

lmbspecialops's Introduction

lmbspecialops

License

lmbspecialops is a collection of tensorflow ops. The ops focus on networks for predicting depth and camera motion as in DeMoN, but many can also be useful for other tasks.

If you use this code for research please cite:

@InProceedings{UZUMIDB17,
  author       = "B. Ummenhofer and H. Zhou and J. Uhrig and N. Mayer and E. Ilg and A. Dosovitskiy and T. Brox",
  title        = "DeMoN: Depth and Motion Network for Learning Monocular Stereo",
  booktitle    = "IEEE Conference on Computer Vision and Pattern Recognition (CVPR)",
  month        = " ",
  year         = "2017",
  url          = "http://lmb.informatik.uni-freiburg.de//Publications/2017/UZUMIDB17"
}

See the Op documentation for a description of all functions.

Requirements

Building and using lmbspecialops depends on the following libraries and programs

tensorflow 1.5.0
cmake 3.8
python 3.5
cuda 8.0.61 (required for building with gpu support)

The versions match the configuration we have tested. lmbspecialops can work with newer versions of the aforementioned dependencies, but this is not well tested.

Installation instructions

Checkout the repository and run setup.py install.

git clone https://github.com/lmb-freiburg/lmbspecialops.git
cd lmbspecialops
pip install cmake-setuptools
python setup.py install

NVCC's CUDA gencode parameters are configured automatically based on available GPU devices.

If necessary, you can use the CUDA_ARCH_LIST environment variable or CMake variable to generate code for specific architectures or compute capabilities instead. CUDA_ARCH_LIST accepts a list of architecture names (e.g. Pascal, Volta, etc) and/or compute capability versions (6.1, 7.0, etc).

To pass any parameters to CMake set the CMAKE_COMMON_VARIABLES environment variable. For example:

export CUDA_ARCH_LIST="Pascal 7.0"
export CMAKE_COMMON_VARIABLES="-DBUILD_WITH_CUDA=OFF" # to disable gpu support
python setup.py install

Alternatively, you can use ccmake or cmake-gui inside the created build directory to configure any CMake variables.

python setup.py build_ext
cd build/temp.*
ccmake .
make clean
cd ../..
python setup.py install

After installation you can import and use the ops like this

import lmbspecialops
import tensorflow as tf
import numpy as np

tf.InteractiveSession()

A = tf.constant([1,2,np.nan])
B = lmbspecialops.replace_nonfinite(A)
print(B.eval()) # prints [1, 2, 0]

Development

For development, it is preferable to use CMake directly without running setup.py.

mkdir build
cd build
cmake ..
# cmake .. -DBUILD_WITH_CUDA=OFF # to disable gpu support
make

To use the ops, you need to add the python directory to your python path.

Use make test in the build directory to run tests.

License

lmbspecialops is under the GNU General Public License v3.0

lmbspecialops's People

Contributors

benjaminum avatar simonselg avatar tonmoy-saikia avatar valgur avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.