pycaffe 'solver.step' fails to train using Adam - caffe

I am trying to train a model using pycaffe. I use Adam Optimizer
The forward and backward codes work fine:
solver.net.forward()
solver.net.backward()
However on the update step (solver.update()) it fails with the following error:
AttributeError: 'AdamSolver' object has no attribute 'update'
F1102 12:14:25.689537 24420 benchmark.cpp:18] Check failed: error == cudaSuccess (10 vs. 0) invalid device ordinal
When I try the solver.step(1) I gives me:
solver.step(1) failed to work with the following error:
F1101 19:28:43.213888 5038 benchmark.cpp:30] Check failed: error == cudaSuccess (71 vs. 0) operation not supported
*** Check failure stack trace: ***
Aborted (core dumped)
I suspect that there is an installation issue, actually I had few test cases that fails in my runtest, is that related and what I would need to fix if I need to rebuild?
EDIT 1:
I fixed all the issues I have in the runtest, but still having the same problem.

Placecaffe.set_mode_gpu() and caffe.set_device(0) before the caffe.get_solver(solver_path) solved the issue.

Related

Magento 2 : Exception #0 (Exception): Recoverable Error:

I have moved one magento 2 website from one server to another, after configuration, I got below error on category pages:
1 exception(s):
Exception #0 (Exception): Recoverable Error: Argument 1 passed to Mageplaza\Core\Helper\AbstractData::__construct() must be an instance of Magento\Framework\App\Helper\Context, instance of Magento\Framework\ObjectManager\ObjectManager given, called in /SOME_PATH/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and defined in /SOME_PATH/app/code/Mageplaza/Core/Helper/AbstractData.php on line 56
Exception #0 (Exception): Recoverable Error: Argument 1 passed to Mageplaza\Core\Helper\AbstractData::__construct() must be an instance of Magento\Framework\App\Helper\Context, instance of Magento\Framework\ObjectManager\ObjectManager given, called in /SOME_PATH/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and defined in /SOME_PATH/app/code/Mageplaza/Core/Helper/AbstractData.php on line 56
I have tried below things to resolve above:
Reindexing
Re-save category pages from backend
Created new category, and found its page working fine.
It seems there is a problem with database where old category urls need to be reindexed/rewritten or processed some way.
Can anyone help me to resolve this or any guide how I can troubleshoot this further?
Any help is appreciated!
Thanks
Deleting var/di directory resolves the problem. I didn't need to run any CLI command nor I need to do any cache clear stuff!

How to catch Joblib/Parallel Exceptions in python?

I have a use case for joblib's Parallel, delayed. I have included some feature that terminates a worker under certain conditions. However, when I do that, I am randomly yielding JoblibWebdriverException, Multiprocessing exception, JoblibURLerror, or just error.
To my great amusement, I don't find any section on how to (define?)/catch Exceptions in the docs.
When I do:
try:
Parallel(delayed(function))
except (JoblibWebdriverException | error | 'Multiprocessing exception'):
# written with separate excepts in original code
log_errors()
I yield name JoblibWebdriverException not defined followed by:
---------
Sub-process traceback
---------
Multiprocessing exception:
(trace stack)
How to catch undefined joblib Exceptions when using Parallel in python?
I would recommend using concurrent.Futures which has robust support for Exception handling. joblib is notorious for not being able to raise Exceptions from child processes to the main thread due to way the multi-processing is set up.

Neo4j-import fails

I'm trying to import a dataset using neo4j-import. Unfortunately the import fails with the following error message which is not saying much to me. Does anyone has an idea?
Thank you
The command was:
./neo4j-import --into /home_expes/dd77474h/neo4j-community-3.0.7/data/databases/graph.db/ --nodes /home_expes/dd77474h/Indexing-server/reduced_dbpedia_nodes.csv --relationships /home_expes/dd77474h/Indexing-server/reduced_dbpedia_relations.csv --stacktrace true --id-type
reduced_dbpedia_nodes.csv:
id:ID,uri,:LABEL
7,"http://dbpedia.org/resource/Albedo",Resource
reduced_dbpedia_relations.csv
:START_ID,:END_ID,:TYPE
1,2,"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
Error message:
Relationship --> Relationship Sparse
[>:231.50 MB/s--------------------------|LINK(3)==|*v:130.76 MB/s-----------------------------] 171M
Done in 24s 824ms
Minority relationships
[*INSERT--------------------------------------------------------------------------------------] 540K
Done in 14m 31s 126ms
Count groups
[*>:??----------------------------------------------------------------------------|COUNT------]12.2M
Done in 2s 786ms
Gather
java.lang.RuntimeException: Panic called, so exiting
at org.neo4j.unsafe.impl.batchimport.staging.AbstractStep.assertHealthy(AbstractStep.java:155)
at org.neo4j.unsafe.impl.batchimport.staging.ProducerStep.process(ProducerStep.java:84)
at org.neo4j.unsafe.impl.batchimport.staging.ProducerStep$1.run(ProducerStep.java:54)
Caused by: java.lang.IllegalStateException: There's no room for me for startIndex:28899 with a group count of -25966. This means that there's an asymmetry between calls to incrementGroupCount and actual contents sent into put
at org.neo4j.unsafe.impl.batchimport.RelationshipGroupCache.scanForFreeFrom(RelationshipGroupCache.java:203)
at org.neo4j.unsafe.impl.batchimport.RelationshipGroupCache.put(RelationshipGroupCache.java:159)
at org.neo4j.unsafe.impl.batchimport.CacheGroupsStep.process(CacheGroupsStep.java:48)
at org.neo4j.unsafe.impl.batchimport.CacheGroupsStep.process(CacheGroupsStep.java:31)
at org.neo4j.unsafe.impl.batchimport.staging.ProcessorStep.lambda$receive$2(ProcessorStep.java:97)
at org.neo4j.unsafe.impl.batchimport.executor.DynamicTaskExecutor$Processor.run(DynamicTaskExecutor.java:243)
Import error: Panic called, so exiting
Caused by:Panic called, so exiting
java.lang.RuntimeException: Panic called, so exiting
at org.neo4j.unsafe.impl.batchimport.staging.AbstractStep.assertHealthy(AbstractStep.java:155)
at org.neo4j.unsafe.impl.batchimport.staging.ProducerStep.process(ProducerStep.java:84)
at org.neo4j.unsafe.impl.batchimport.staging.ProducerStep$1.run(ProducerStep.java:54)
Caused by: java.lang.IllegalStateException: There's no room for me for startIndex:28899 with a group count of -25966. This means that there's an asymmetry between calls to incrementGroupCount and actual contents sent into put
at org.neo4j.unsafe.impl.batchimport.RelationshipGroupCache.scanForFreeFrom(RelationshipGroupCache.java:203)
at org.neo4j.unsafe.impl.batchimport.RelationshipGroupCache.put(RelationshipGroupCache.java:159)
at org.neo4j.unsafe.impl.batchimport.CacheGroupsStep.process(CacheGroupsStep.java:48)
at org.neo4j.unsafe.impl.batchimport.CacheGroupsStep.process(CacheGroupsStep.java:31)
at org.neo4j.unsafe.impl.batchimport.staging.ProcessorStep.lambda$receive$2(ProcessorStep.java:97)
at org.neo4j.unsafe.impl.batchimport.executor.DynamicTaskExecutor$Processor.run(DynamicTaskExecutor.java:243)
Thanks for your help, I found the bug. FYI see https://github.com/neo4j/neo4j/pull/8778 for fix.

MailCore2 MCHTMLCleaner error

While using MailCore2, I started getting an error in MCHTMLCleaner.cc and method HTMLCleaner::cleanHTML. The specific line that is throwing the error is:
rc = tidySetErrorBuffer(tdoc, &errbuf);
and the error being printed is:
'Assertion failed: (option_defs[ optId ].type == TidyInteger), function SetOptionInt, file ../../src/config.c, line 381'
In config.c on line 381 is:
Bool status = ( optId < N_TIDY_OPTIONS );
Occasionally, this will crash the app, which seems contrary to the entire idea of a try/catch block that would make the most sense here.
More often than not, this code/file will not stop the app and instead just print out an error.
What is causing this to crash? Has anyone else experienced this? IS the HTML actually being cleaned or is nothing being returned for you?
Here is a link to the specific file in question on GitHub.

BeepBeep and ErlyDB integration issue

Further to my adventures with Erlang and ErlyDB. I am attempting to get ErlyDB working with BeepBeep
My ErlyDB setup works correctly when run outside of the BeepBeep environment (see Debugging ErlyDB and MySQL). I have basically take the working code and attempted to get it running inside BeepBeep.
I have the following code in my controller:
handle_request("index",[]) ->
erlydb:start(mysql,Database),
erlydb:code_gen(["thing.erl"],mysql),
NewThing = thing:new_with([{name, "name"},{value, "value"}]),
thing:save(NewThing),
{render,"home/index.html",[{data,"Hello World!"}]};
When I call the URL, the response outputs "Server Error".
There is no other error or exception information reported.
I have tried wrapping the call in try/catch to see if there is an underlying error - there is definitely an exception at the call to thing:new_with(), but no further information is available.
The stacktrace reports:
{thing,new,[["name","value"]]}
{home_controller,create,1}
{home_controller,handle_request,3}
{beepbeep,process_request,4}
{test_web,loop,1}
{mochiweb_http,headers,4}
{proc_lib,init_p_do_apply,3}
Use pattern matching to assert that things work up to the call to thing:new/1:
ok = erlydb:start(mysql,Database),
ok = erlydb:code_gen(["thing.erl"],mysql),
You include only the stack trace, look at the exception message as well. I suspect that the error is that you get an 'undef' exception. But check that it is so. The first line in the stack trace indicates that it is a problem with calling thing:new/1 with ["name", "value"] as argument.
It is slightly odd that you show one clause of handle_request that is not calling home_controller:create/1 as per {home_controller,create,1} in the stack-trace. What do the other clauses in your handle_request/2 function look like?