Raspberry Pi 2 with Caffe protobuf error - protocol-buffers

Has anyone successfuly launched Caffe on Raspberry Pi 2? I installed OpenCV and Caffe without errors (eventually). But when i launch my C++ code that uses OpenCV and Caffe, it throws this error:
[libprotobuf ERROR google/protobuf/descriptor_database.cc:57] File already exists in database: caffe.proto
[libprotobuf FATAL google/protobuf/descriptor.cc:1018] CHECK failed: generated_database_->Add(encoded_file_descriptor, size):
terminate called after throwing an instance of 'google::protobuf::FatalException'
what(): CHECK failed: generated_database_->Add(encoded_file_descriptor, size):
Aborted
I tried installing a newer protobuf version, but that did not help. Some suggested that this is due to using dynamic libs, but this C++ code runs fine on other devices in GPU and CPU mode. It uses about 600MB of RAM and the R. Pi had 822MB of free RAM.

Rebuilding opencv with -D BUILD_opencv_dnn=OFF and then rebuilding caffe solved the issue. However i'm not sure if i don't use the opencv_dnn library.

Related

Trouble running tensorflow serving on different macs: CHECK failed: file != nullptr

I'm struggling to run the same tensorflow serving docker image on two different mac computers.
Here is the dockerfile
FROM tensorflow/serving:2.6.0
RUN mkdir /models
WORKDIR /models
COPY ./ /models
EXPOSE 8080
ENTRYPOINT tensorflow_model_server --rest_api_port=8080 --model_name=MyModel --model_base_path=/models/
When I build and run this on Mac 1, it works fine.
However, on Mac 2, the following error occurs:
[libprotobuf FATAL external/com_google_protobuf/src/google/protobuf/generated_message_reflection.cc:2345] CHECK failed: file != nullptr:
terminate called after throwing an instance of 'google::protobuf::FatalException'
what(): CHECK failed: file != nullptr:
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted
Does anyone know why is happening, and how to prevent it? Thanks!
Mac 1 specs:
MacOS Monterey Version 12.5
Processor: Quad-Core Intel Core i7
Mac2 specs:
MacOS Monterey Version 12.0.1 (21A559)
Chip: Apple M1 Pro
I have not seen this error. Yet if it works with i7 and not M1, it might be because your TensorFlow serving image does not work with arm64 arch. You may need a custom build
I have found one here : build for apple's M1
but I am having difficulties myself to run it.
Edit: actually it runs now

Installing OMNeT++ on M1 MacBook

Followed instructions given in https://doc.omnetpp.org/omnetpp/InstallGuide.pdf
OMNeT++ Version - omnetpp-5.6.2
Device - MacBook Air M1 (MacOS Big Sur Version 11.4)
Encountered the following problems.
$. setenv -> didn't work (worked after replacing "." with "source")
$./configure -> gives the following error.
configure: error: Qtenv cannot find qmake -- maybe it is not in the PATH or has some exotic name (tested names were: qmake qmake-qt5 qmake5) - disabling Qtenv. You can try setting the QT_PATH variable in configure.user to a valid location
$ make -> gives the following error.
Makefile:54: Makefile.inc: No such file or directory
make: *** No rule to make target `Makefile.inc'. Stop.
Is it possible to get OMNeT++ working on M1 Macs? Any help would be greatly appreciated.
Thanks in advance.
There is no native support for M1 processors, especially because omnet++ 5.6 was released way before the M1 release, but you can run omnet with Rosetta2 in x86_64 mode. You would still get pretty decent performance. With x86_64 emulation I measured similar performance like on my last year high end AMD laptop. Native mode would give you a 25% boost compared to that.
To turn on the emulation for a shell window, start a new shell with
$ arch -x86_64 /bin/zsh --login
and then continue in that shell with
$ source setenv
$ ./configure
$ make
run everything from that shell window (as usual).
NOTE: OMNeT++ 5.6 relies on the system-wide installed JRE to run the IDE. That may NOT be present on your system if you are running on ARM. OMNeT++ 6 and 5.7 comes with a built-in private JRE, so the IDE should work with those versions also in intel emulation mode.
ps: OMNeT++ 6 may get native M1 support (this depends on the availability of some dependencies (JavaVM, Qt etc.). I'm also considering an ARM based docker image, that would allow running at native performance (as long as you have an XServer installed).

Rstudio not working on my Ubuntu 16 virtual machine

When I try to run Rstudio Desktop (1.4) on my virtual machine (Ubuntu 16.4), Rstudio crashes and gives the error:
ERROR:gl_surface_glx_gt.cpp(141) GLX 1.3 or later is required.
I tried to follow the instructions on this page: https://wiki.x2go.org/doku.php/wiki:development:glx-xlib-workaround, but can not get past the meson -D configuration in the Ubuntu terminal. At this point I get the error message: 'ERROR: Problem encountered: gallium-xlib conflicts with any dri driver'
I googled and tried everything that I could possibly find (similar questions as https://community.rstudio.com/t/x2go-and-rstudio/29704/2), but no success yet.
Obviously the upgrade to a higher GLX version is the cause, but I can not upgrade it.
Is anyone familiar with the error and what is actually causing it?
Any help would be greatly appreciated!
I am using R version 3.4.4

Caffe 2 Install fails on Windows 10

It's been a fairly treacherous journey with dozens of error messages. I am installing Caffe 2 from source onto a Windows 10 machine with an Nvidia GPU. I have installed VS2017 Community Edition (CE), CUDA 9.2 and cuDNN. I am able to build the CUDA sample .sln files into .exe's and run the .exe's successfully.
Presently, I am trying to install Caffe 2. Naturally, there's an error on this step as well. Like my previous issues, I have tried Googling this error. Unfortunately, I am unable to find others with the same issue and consequently cannot find hints for a solution.
According to the Caffe 2 installation instrucitons at: https://caffe2.ai/docs/getting-started.html?platform=windows&configuration=compile:
1. git clone --recursive https://github.com/pytorch/pytorch.git
2. build_windows.bat from the Developer Command Prompt for VS 2017
on step 2., I get the following error:
"C:\Users\andcy\pytorch\build\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\andcy\pytorch\build\caffe2\caffe2.vcxproj" (default target) (13) ->
(ClCompile target) ->
c:\users\andcy\pytorch\third_party\eigen\eigen\src\core\products\generalblockpanelkernel.h(1902): fatal error C1001: An internal error has occurred in the compiler. [C:\Users\andcy\pytorch\build\caffe2\caffe2.vcxproj]
cl : Command line error D8040: error creating or communicating with child process [C:\Users\andcy\pytorch\build\caffe2\caffe2.vcxproj]
3282 Warning(s)
2 Error(s)
Time Elapsed 00:05:11.58
"Caffe2 building failed"
C:\Users\andcy\pytorch\scripts>
Does anyone have any advice on how to resolve this issue? I've been trying to install Caffe 2 on my local machine for about a week.
Well, according to the official troubleshooting section of Caffe2,
Until NVIDIA updates CUDA to support VS 17, you’re going to have to install VS 15 and try again.
So, you need to install Visual Studio 15 to install Caffe2 on Windows 10. The troubleshooting section can be found at Install Caffe2 on Windows

OpenCV installation on windows

I'm trying to install OpenCV on Windows and I followed the Installation by Using git-bash (version>=2.14.1) and cmake (version >=3.9.1) tutorial from the official OpenCV documentation but when I run the build operation I get an error.
I'm using:
Windows 10
CMake 3.9.1
Git Bash 2.17.0
TDM64 GCC compiler 5.1.0
Here's the error
In file included from C:\lib\opencv\modules\videoio\src\cap_msmf.cpp:59:0:
C:/TDM-GCC-64/x86_64-w64-mingw32/include/mfplay.h:77:50: error: 'MFP_MEDIAITEM_CHARACTERISTICS' has not been declared
STDMETHOD_(HRESULT,GetCharacteristics)(THIS_ MFP_MEDIAITEM_CHARACTERISTICS *pCharacteristics) PURE;
^
C:/TDM-GCC-64/x86_64-w64-mingw32/include/mfplay.h:79:46: error: 'IMFPMediaPlayer' has not been declared
STDMETHOD_(HRESULT,GetMediaPlayer)(THIS_ IMFPMediaPlayer **ppMediaPlayer) PURE;
Did someone encounter this kind of error?
Yes I also encountered this error (when compiling with MinGW-w64 gcc 8.1).
For you and anybody else who finds this question when this error occurs (like me), here's what solved the issue for me:
When not using Visual Studio, you have to disable some features which are not supported. Build with cmake options WITH_IPP=OFF and WITH_MSMF=OFF
Solution found on opencv answers: http://answers.opencv.org/question/192758/compile-error-when-compiling-for-windows-341-dev/

Resources