CEA-LIST / N2D2

N2D2 is an open source CAD framework for Deep Neural Network simulation and full DNN-based applications building.
Other
146 stars 36 forks source link

Couldn't open connection to gnuplot #47

Closed GasparQ closed 4 years ago

GasparQ commented 4 years ago

Hello everyone, I'm currently facing an issue that I don't understand so much.

Issue

I'm trying to train a ResNet with N2D2 and I have the following error : Couldn't open connection to gnuplot (is it in the PATH?)

Debug

Then I try to understand why this error is raised :

libstdc++.so.6!__cxxabiv1::__cxa_throw(void * obj, std::type_info * tinfo, void (*)(void *) dest) (\usr\src\debug\gcc-4.8.5-20150702\libstdc++-v3\libsupc++\eh_throw.cc:62)
N2D2::Gnuplot::Gnuplot(N2D2::Gnuplot * const this, const std::string & fileName) (\home\thales\N2D2\src\utils\Gnuplot.cpp:44)
N2D2::PoolCell::writeMap(const N2D2::PoolCell * const this, const std::string & fileName) (\home\thales\N2D2\src\Cell\PoolCell.cpp:95)
N2D2::PoolCellGenerator::generate(N2D2::Network & network, const N2D2::DeepNet & deepNet, N2D2::StimuliProvider & sp, const std::vector<std::shared_ptr<N2D2::Cell>, std::allocator<std::shared_ptr<N2D2::Cell> > > & parents, N2D2::IniParser & iniConfig, const std::string & section) (\home\thales\N2D2\src\Generator\PoolCellGenerator.cpp:211)
std::_Function_handler<std::shared_ptr<N2D2::Cell> (N2D2::Network&, N2D2::DeepNet const&, N2D2::StimuliProvider&, std::vector<std::shared_ptr<N2D2::Cell>, std::allocator<std::shared_ptr<N2D2::Cell> > > const&, N2D2::IniParser&, std::string const&), std::shared_ptr<N2D2::PoolCell> (*)(N2D2::Network&, N2D2::DeepNet const&, N2D2::StimuliProvider&, std::vector<std::shared_ptr<N2D2::Cell>, std::allocator<std::shared_ptr<N2D2::Cell> > > const&, N2D2::IniParser&, std::string const&)>::_M_invoke(std::_Any_data const&, N2D2::Network&, N2D2::DeepNet const&, N2D2::StimuliProvider&, std::vector<std::shared_ptr<N2D2::Cell>, std::allocator<std::shared_ptr<N2D2::Cell> > > const&, N2D2::IniParser&, std::string const&)(const std::_Any_data & __functor,  __args#0,  __args#1,  __args#2,  __args#3,  __args#4,  __args#5) (\usr\include\c++\4.8.2\functional:2057)
std::function<std::shared_ptr<N2D2::Cell> (N2D2::Network&, N2D2::DeepNet const&, N2D2::StimuliProvider&, std::vector<std::shared_ptr<N2D2::Cell>, std::allocator<std::shared_ptr<N2D2::Cell> > > const&, N2D2::IniParser&, std::string const&)>::operator()(N2D2::Network&, N2D2::DeepNet const&, N2D2::StimuliProvider&, std::vector<std::shared_ptr<N2D2::Cell>, std::allocator<std::shared_ptr<N2D2::Cell> > > const&, N2D2::IniParser&, std::string const&) const(const std::function<std::shared_ptr<N2D2::Cell>(N2D2::Network&, const N2D2::DeepNet&, N2D2::StimuliProvider&, const std::vector<std::shared_ptr<N2D2::Cell>, std::allocator<std::shared_ptr<N2D2::Cell> > >&, N2D2::IniParser&, const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)> * const this,  __args#0,  __args#1,  __args#2,  __args#3,  __args#4,  __args#5) (\usr\include\c++\4.8.2\functional:2471)
N2D2::CellGenerator::generate(N2D2::Network & network, const N2D2::DeepNet & deepNet, N2D2::StimuliProvider & sp, const std::vector<std::shared_ptr<N2D2::Cell>, std::allocator<std::shared_ptr<N2D2::Cell> > > & parents, N2D2::IniParser & iniConfig, const std::string & section) (\home\thales\N2D2\src\Generator\CellGenerator.cpp:45)
N2D2::DeepNetGenerator::generate(N2D2::Network & network, const std::string & fileName) (\home\thales\N2D2\src\Generator\DeepNetGenerator.cpp:249)
main(int argc, char ** argv) (\home\thales\N2D2\exec\n2d2.cpp:1739)

It seems that the construction of a N2D2::GnuPlot::GnuPlot object causes the error because the popen function returns NULL value.

Therefore, I print the strerror(errno) resulting in this issue and I have the following message : Cannot allocate memory

After some researches it seems that the fork function called by the popen is the only one that can generate this kind of error, so it make me think that it's maybe a configuration issue.

Configuration

I'm currently working into a Centos7 VM with the following configuration :

Conclusions

This error seems to be a configuration error because the training of mnist24_16c4s2_24c5s2_150_10 model works perfectly fine.

On the ResNet models (18 and 50) error are thrown on the Utils::exec function where popen returns NULL too, so it comforts me in the idea that it's a configuration problem.

Here is an archive with the ini file I used : ResNet-mini.zip

Did you face this issue before ?

GasparQ commented 4 years ago

Ok never mind, I found the problem. I just didn't have enough memory on my VM and just update to 12Go : image (1)