Caffe "Unknown solver type : SGD" - c++

Build Caffe (latest version, CPU only build) under Windows 10 for use in VS C++ project. So that everything began to work had to trouble. But when creating an instance of the Solver class, an error occurs.
SolverParameter solverParam;
ReadSolverParamsFromTextFileOrDie("solver.prototxt", &solverParam);
boost::shared_ptr<Solver<float>> solver(SolverRegistry<float>::CreateSolver(solverParam));
Output:
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0601 14:21:42.943118 10832 solver_factory.cpp:29] Check failed: registry.count(type) == 1 (0 vs. 1) Unknown solver type: SGD (known types: )
*** Check failure stack trace: ***
solver.prototxt content:
net: "model.prototxt"
base_lr: 0.02
lr_policy: "step"
gamma: 0.5
stepsize: 500000
display: 10
max_iter: 5000
snapshot: 1000000
snapshot_prefix: "XORProblem"
solver_mode: CPU
test_iter: 1
test_interval: 2000
What is the reason?

It seems like you did not define the type of the solver at all.
Try adding
type: "SGD"
to your 'solver.prototxt'.
Solver type should by "SGD" by default, but there are two ways to define it: one is using solver_type: SGD, and the other is using type: "SGD". The first option is marked as "deprecated" in the comments, so I guess this gives you trouble.
Try avoiding the default settings by explicitly setting the solver type using a non-deprecated method.
Update:
Looking at the windows branch readme it seems like there is an open issue with compiling shared library under windows, specifically with the solvers.
I believe the issue you are experiencing is related to that issue.

I solved the problem by including "caffe/solvers/sgd_solver.cpp" into "caffe.cpp".

Related

Error calling the kernel: error code is: -6 on openCL kernel

my question is little different than that being asked on this platform, but I think it is related to programming.
I am using vitis and alveo accelerators. They basically have a host program( written in C++) and than a openCL file, which is also kind of C programming.
The host asks the kernel to do some thing by putting the input data through arguments and than results are send back to the host.
There are 3 ways to execute the data on kernel( Software emulation, HW emulation and Hardware). Generally, we start with Software emulation and than with Hardware. I have always seen that when code gets build and run with software emulation, it also builds and run on Hardware.
But I am getting a strange error as below:
INFO: Reading /home/m992c693/Workspace C2Q TC _paper/qht_3d_system/Hardware/vector addition.xclbin
Loading: '/home/m992c693/Workspace C20 TC_paper/qht_3d_system/Hardware/vector_addition.xclbin
Trying to program device[6]: xilinx_u250_gen3x16_xdma_shell_4 |
Device[6]: program successful
-./src/host.cpp:585 Error calling krnt_c2q =
XRT build version: 2.13.466
Build hash: 5505e402c2calffe45eb6d3a9399b23a0dc8776
Build date: 2022-04-14 17:45:07
Git branch: 2022.1
PID: 243276
UID: 100586768
[Tue Sep 27 17:35:28 2622 GMT!
HOST: alveo
EXE: /home/m992c693/Workspace C20 TC_paper/qht_3d/Hardware/qht_3d
[XRT] ERROR: No such compute unit ‘c2q:c2q 1': Invalid argument
:Kernel (program, “c2q", Serr), error code is: -6
It would be great if someone can guide me why I am getting this error and what kind of debugging procedure I should follow.

DLIB: train_shape_predictor_ex.exe for 194 landmarks with halen dataset gives runtime error: bad allocation

I am trying train dlib's shape_predictor for 194 landmarks with halen dataset
but it gives bad allocation exception when I run it command prompt
D:\Facial Feature Extraction>train_shape_predictor_ex.exe face_detector
Program is started
exception thrown!
bad allocation
, I reduced the number of image to only 50 then it run successfully but the result is not satisfactory. So I tried to train with 64 GB RAM System but bow I increased the parameter
trainer.set_nu(0.05);
trainer.set_tree_depth(2);
but now it is still showing bad allocation error. If I train with less data and for smaller parameter the train model is not correct.
Build your application in Release Mode and target to 64-bit Windows plateform.
Also Enable \LARGEADDRESSAWARE Flag in your Project.
Here is a link to your question:
Answer

Why is my cuda sum program not working on the device end? [duplicate]

I am getting the following error when running the default generated kernel when creating a CUDA project in VS Community:
addKernel launch failed: invalid device function
addWithCuda failed!
I searched for how to solve it, and found out that have to change the Project->Properties->CUDA C/C++->Device->Code Generation(default values for [architecture, code] are compute_20,sm_20), but I couldn't find the values needed for my graphic card (GeForce 8400 GS)
Is there any list on the net for the [architecture, code] or is it possible to get them by any command?
The numeric value in compute_XX and sm_XX are the Compute Capability (CC) for your CUDA device.
You can lookup this link http://en.wikipedia.org/wiki/CUDA#Supported_GPUs for a (maybe not complete) list of GPUs and there corresponding CC.
Your quite old 8400 GS (when I remember correctly) hosts a G86 chip which supports CC 1.1.
So you have to change to compute_11,sm_11
`

OpenCascade ErrorStatus

i use OpenCasCade 6.7.0.
When I Call the function BRepAlgoAPI_Cut and check ErrorStatus() i get 114 as result. Watching in documentation i got following Information:
0 - Ok
1 - The Object is created but Nothing is Done
2 - Null source shapes isstrong text not allowed
3 - Check types of the arguments
4 - Can not allocate memory for the DSFiller
5 - The Builder can not work with such types of arguments
6 - Unknown operation is not allowed
7 - Can not allocate memory for the Builder
>100 - See the Builder's ErrorStatus
What is that Builders ErrorStatus? Where can i find it?
After asking this Qestion in the Official OCC Forum i got following Answer:
Dear Hahn,
thank you for your observation. In fact error status 114 of the BRepAlgoAPI_Cut means that the types of arguments do not allow to perform the CUT operation (for example, it is impossible to cut a vertex from a solid). We are planning to revise documentation on all BOA error messages. However I cannot guarantee that it will happen very soon. It depends on the availability of our internal resources.
Best regards,
Forum Supervisor

Getting OpenCV Error: Insufficient memory while running OpenCV Sample Program: "stitching_detailed.cpp"

I recently starting working with OpenCV with the intent of stitching large amounts of images together to create massive panoramas. To begin my experimentation, I looked into the sample programs that come with the OpenCV files to get an idea about how to implement the OpenCV libraries. Since I was interested in image stitching, I went straight for the "stitching_detailed.cpp." The code can be found at:
https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/cpp/stitching_detailed.cpp?rev=6856
Now, this program does most of what I need it to do, but I ran into something interesting. I found that for 9 out of 15 of the optional projection warpers, I receive the following error when I try to run the program:
Insufficient memory (Failed to allocate XXXXXXXXXX bytes) in unknown function,
file C:\slave\winInstallerMegaPack\src\opencv\modules\core\src\alloc.cpp,
line 52
where the "X's" mark integer that change between the different types of projection (as though different methods require different amounts of space). The full source code for "alloc.cpp" can be found at the following website:
https://code.ros.org/trac/opencv/browser/trunk/opencv/modules/core/src/alloc.cpp?rev=3060
However, the line of code that emits this error in alloc.cpp is:
static void* OutOfMemoryError(size_t size)
{
--HERE--> CV_Error_(CV_StsNoMem, ("Failed to allocate %lu bytes", (unsigned long)size));
return 0;
}
So, I am simply lost as to the possible reasons that this error may be occurring. I realize that this error would normally occur if the system is out of memory, but I when running this program with my test images I am never using more that ~3.5GB of RAM, according to my Task Manager.
Also, since the program was written as an sample of the OpenCV stitching capabilities BY OpenCV developers I find it hard to believe that there is a drastic memory error present within the source code.
Finally, the program works fine if I use some of the warping methods:
- spherical
- fisheye
- transverseMercator
- compressedPlanePortraitA2B1
- paniniPortraitA2B1
- paniniPortraitA1.5B1)
but as ask the program to use any of the others (through the command line tag
--warp [PROJECTION_NAME]):
- plane
- cylindrical
- stereographic
- compressedPlaneA2B1
- mercator
- compressedPlaneA1.5B1
- compressedPlanePortraitA1.5B1
- paniniA2B1
- paniniA1.5B1
I get the error mentioned above. I get pretty good results from the transverseMercator project warper, but I would like to test the stereographic in particular. Can anyone help me figure this out?
The pictures that I am trying to process are 1360 x 1024 in resolution and my computer has the following stats:
Model: HP Z800 Workstation
Operating System: Windows 7 enterprise 64-bit OPS
Processor: Intel Xeon 2.40GHz (12 cores)
Memory: 14GB RAM
Hard Drive: 1TB Hitachi
Video Card: ATI FirePro V4800
Any help would be greatly appreciated, thanks!
When I run OpenCV's APP traincascade, i get just the same error as you:
Insufficient memory (Failed to allocate XXXXXXXXXX bytes) in unknown function,
file C:\slave\winInstallerMegaPack\src\opencv\modules\core\src\alloc.cpp,
line 52
at the time, only about 70% pecent of my RAM(6G) was occupied. And when runnig trainscascade step by step, I found that the error would be thrown.when it use about more than 1.5G RAM space.
then, I found the are two arguments which can control how many memory should be used:
-precalcValBufSize
-precalcIdxBufSize
so i tried to set these two to 128, it run. I hope my experience can help you.
I thought this problem is nothing about memory leak, it is just relate to how many memory the OS limits a application occupy. I expect someone can check my guess.
I've recently had a similar issue with OpenCV image stitching. I've used create method to create stitcher instance and provided 5 images in vertical order to stitch method, but I've received insufficient memory error.
Panorama was successfully created after setting:
setWaveCorrection(false)
This solution will not be applicable if you need wave correction.
This may be related to the sequence of the stitching, I split a big picture into 3*3, and firstly I stitch them row by row and there is no problem, when I stitch them column by column, there is the problem same as you.