jatinchowdhury18 / RTNeural-Experimental

RTNeural Experiments
2 stars 0 forks source link

EIGEN - OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG #1

Open robjlyons opened 7 months ago

robjlyons commented 7 months ago

Hi, when running:

cmake --build build --config Release

I get the error:

RTNeural-Experimental/build/_deps/rtneural-src/modules/Eigen/Eigen/src/Core/DenseStorage.h:33:3: error: static_assert failed due to requirement '256032 sizeof(float) <= 131072' "OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG" EIGEN_STATIC_ASSERT(Size sizeof(T) <= EIGEN_STACK_ALLOCATION_LIMIT, OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG);

The steps I took to get this error are:

git clone --recursive https://github.com/jatinchowdhury18/RTNeural-Experimental
cd RTNeural-Experimental
cmake -Bbuild
cmake --build build --config Release

I have attached the full error log I get from running this on my mac. RTNeural_experiments_cmake_error.txt

NOTE: I did remove the residual_connection subfolder in the example/cmakelist.txt file:

if(APPLE)
    add_subdirectory(accelerate)
endif()
add_subdirectory(snafx)

as it was causing an error of: #include "tests/load_csv.hpp" not found

jatinchowdhury18 commented 7 months ago

Sure thing! The issue that you're running into happens when Eigen detects that the amount of memory it would need to allocate on the stack might cause a stack overflow. The way around this is to use the dynamic_state option for the convolutional layers that are having this issue. See here: https://github.com/jatinchowdhury18/RTNeural/blob/main/RTNeural/conv1d/conv1d.h#L177