Giter Club home page Giter Club logo

compilednn's People

Contributors

ahasselbring avatar anbau avatar fthielke avatar h3ndrk avatar laurendus avatar thomasroefer 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

compilednn's Issues

Segmentation Fault in Tensor.h:225

At HULKs, we are experiencing sporadic segmentation faults at:

inline T& operator[](const std::size_t index) { return *(dataOffset + index); }

In our code, we get a segmentation fault when we are using nn.input(0)[528]. The following assertions hold true in our use case:

assert(nn.input(0).size() == 1024);
assert(nn.input(0).dims().size() == 3);
assert(nn.input(0).dims()[0] == 32);
assert(nn.input(0).dims()[1] == 32);
assert(nn.input(0).dims()[2] == 1);
assert(nn.input(0).rank() == 3);
assert(nn.input(0).capacity() == 8195);

The internal Tensor::buffer has length 32795 and alignmentShift has an upper bound of 64. I then conclude that the buffer should be large enough for our nn.input(0)[528].

CompiledNN is used in a multithreaded program where we have separate loaded models and compiled nets per thread (should therefore be thread-safe).

It seems that some input data triggers the segmentation fault more often than other, but we don't know why.

Testing

At least the individual operation compilers need to be automatically tested for correctness. This has already been started for the UpSampling2D operation. A further step would be testing the merging of layers.

  • Activation
  • Arithmetic
  • BatchNormalization
  • Concatenate
  • Conv2D
  • Cropping2D
  • DConv2D
  • Dense
  • GlobalPooling2D
  • Im2Col2D
  • Pooling2D
  • Softmax
  • UInt8Input
  • UpSampling2D
  • ZeroPadding2D

Summary of the original issue description in the B-Human repository:

We do not know whether inference is always correct. Some bugs are known, but there are probably more that just do not occur in the models we use. We need systematic, unit-test-like tests which create all kinds of network architectures, apply them to random data and compare the result of CompiledNN to SimpleNN. The goal is 100% path coverage of all compiler classes, also considering that some layers can sometimes be fused. The tests should be a standalone executable in the CompiledNN repository. A nice addition would be the evaluation of execution times of different model configurations. E.g., once the implementations of Im2Col and Conv1x1 are done, there need to be systematic comparisons between Conv2D and Im2Col + Conv1x1.

ASSERT(input.dims(2) <= settings.xmmRegs() * 4) failed

Hello,

I'm trying to compile a simple model

inputs = Input((120,160,1))
conv1 = Conv2D(64, 3, activation = 'relu', padding = 'same')(inputs)
pool1 = MaxPooling2D(pool_size=(2, 2))(conv1)
conv2 = Conv2D(128, 3, activation = 'relu', padding = 'same')(pool1)
up1 = UpSampling2D(size = (2,2))(conv2)
merge = Concatenate()([up1,conv1]                 )
conv3 = Conv2D(64, 3, activation = 'relu', padding = 'same')(merge)
outputs = Conv2D(64, (1,1))(conv3)

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

but I get the following error, which i don't fully understand.

/home/barth/Workspace/CompiledNN/Src/CompiledNN/CompiledNN/Operations/UpSampling2D.cpp:25: ASSERT(input.dims(2) <= settings.xmmRegs() * 4) failed
Aborted (core dumped)

build failed

Could someone help me setup the project?
i tried making a main.cpp file with the code in the readme file.
I extended the CMakeFile.txt with

add_executable(main main.cpp)
target_link_libraries(main PRIVATE CompiledNN)

I build with

mkdir _build && cd _build
cmake .. -G "Unix Makefiles"
cmake --build .

but i get the following error:

CMakeFiles/main.dir/main.cpp.o: In Funktion »NeuralNetwork::CompiledNN::apply() const«:
main.cpp:(.text._ZNK13NeuralNetwork10CompiledNN5applyEv[_ZNK13NeuralNetwork10CompiledNN5applyEv]+0x3c): Warnung: undefinierter Verweis auf »Assert::print(char const*, int, char const*, ...)«
main.cpp:(.text._ZNK13NeuralNetwork10CompiledNN5applyEv[_ZNK13NeuralNetwork10CompiledNN5applyEv]+0x41): Warnung: undefinierter Verweis auf »Assert::abort()«
collect2: error: ld returned 1 exit status
CMakeFiles/main.dir/build.make:90: recipe for target 'main' failed
make[2]: *** [main] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/main.dir/all' failed
make[1]: *** [CMakeFiles/main.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Installation fails

Hey,

I just tried your repo and the command make install fails with the following error:

[100%] Built target CompiledNN
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/lib/libCompiledNN.a
-- Installing: /usr/local/include/CompiledNN/CompiledNN.h
-- Installing: /usr/local/include/CompiledNN/Model.h
-- Installing: /usr/local/include/CompiledNN/SimpleNN.h
-- Installing: /usr/local/include/CompiledNN/Tensor.h
-- Installing: /usr/local/include/CompiledNN/CompiledNN/CompilationSettings.h
-- Installing: /usr/local/include/CompiledNN/Platform/BHAssert.h
CMake Error at cmake_install.cmake:67 (file):
  file INSTALL cannot find
  "/tmp/CompiledNN/3rdParty/B-Human/Tools/Math/BHMath.h": No such file or
  directory.

make: *** [Makefile:100: install] Error 1

This file does indeed not exist in my folder structure, but there is B-Human/MathBase/ and commit b6ecd81 which might be related.

CompiledNN/Src/Model.cpp:300: ASSERT(result) failed

Hey,

I'm currently trying to compile my network with your lib. As the title says I get an ASSERT(result) failed in NeuralNetwork::Model::parseJSONModel.
In the example you are giving it says:

Model model;
model.load("model.h5");

Though I could not find a load(...) function and thus used:

Model model;
model.loadKerasHDF5("model.h5");

My network is saved using model.save(...), is there anything else needed?
I am using Keras Version 2.1.3. Which version are you using and have you yet experienced incompatible versions?

Conv2D: biasOffset thing is not working

It needs to be handled at runtime, not at compile time. This currently limits the number of channels to at most one full batch (plus another non-full batch).

Onnx support

Currently, the loading ONNX files results in the following output:

/tmp/CompiledNN/Src/CompiledNN/Formats/ONNX.cpp:37: FAIL: Not yet implemented.

ONNX would be cool as it is not so dependent on the training framework and some code seems to be there.

Documentation

Is the README the only documentation? In particular, I'm looking to create a tiny_dnn-compatible 2d convolutional layer using CompiledNN, in order to benchmark it against a new one I created "tiny_jnn", but I don't want to replace the rest of our pipeline - just the one layer.

'Platform/BHAssert.h' file not found

I'm trying to add a new target with an example usage of this library to the cmake file. Linking against the CompiledNN library yields this error though.

If I understand the cmake stuff correctly, this is because the B-Human subdirectory is included as PRIVATE. So targets depending on CompiledNN don't transitively include the files as well.

To fix this, I think, one has to either include the B-Human subdirectory as PUBLIC or remove the uses from the public headers of CompiledNN.

Conv2D: canBeInplace-condition is wrong

This is because the store-operations write four elements even when there are only two or three, which overwrites data that need to be read in the future.

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.