Failed to create cuSolverDN instance - python

tensorflow version:1.12, cuda version:10.0
When I build my code, there is a error message:
2019-03-23 18:53:29.965772: I tensorflow/core/kernels/cuda_solvers.cc:159] Creating CudaSolver handles for stream 0x55c9d5a16320
2019-03-23 18:53:30.063068: F tensorflow/core/kernels/cuda_solvers.cc:94] Check failed: cusolverDnCreate(&cusolver_dn_handle) == CUSOLVER_STATUS_SUCCESS Failed to create cuSolverDN instance.
This problem occurred after I wrote code about distribution(from tensorflow-probability). Of course if I remove the code and compile again, there is nothing happened.
Is there any way to solve this problem?

Related

`Error: MLIR Pass Manager Failed': TensorFlow on MacBook Pro M1 Max

I'm running Python 3.9.7 and TensorFlow 2.5 on my MacBook Pro with M1 Max chip, in a virtual environment managed through MiniForge. (Setup due to Jeff Heaton).
I have a custom loss function in the model. This code runs fine on my other machine, which is Ubuntu-based Pop!OS.
When I run model.fit from Keras, I occasionally get the following errors. Sometimes it runs just fine. Any idea what's causing it, why it only happens sometimes, and how to fix it?
In addition, it only produces this error from my custom loss function. Not from any Keras-native.
Thanks!
:5:10: error: invalid length (0) for size 20 | 0.00/1.00 [00:00<?, ?batch/s]
-:5:10: error: 'mps.slice' op failed to fold or infer return types
-:5:10: note: see current operation: %2 = "mps.slice"(%arg0) {axis = 0 : si32, length = 999 : i32, start = 1 : i32} : (tensor<20xf32>) -> tensor<*xf32>
/System/Volumes/Data/SWE/macOS/BuildRoots/5b2e67f8af/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShadersGraph/MetalPerformanceShadersGraph-2.2.1/mpsgraph/MetalPerformanceShadersGraph/Core/Files/MPSGraphExecutable.mm:1179: failed assertion `Error: MLIR pass manager failed'
model.fit(tf.convert_to_tensor(Σ),tf.zeros((T,output)),batch_size=T,epochs=1,verbose=0,callbacks=[TqdmCallback()])#,tbc])
zsh: abort python3
(tensorflow) kpmott#kevins-mbp-7 tf.olg % model.fit(tf.convert_to_tensor(Σ),tf.zeros((T,output)),batch_size=T,epochs=1,verbose=0,callbacks=[TqdmCallback()])#,tbc])
zsh: parse error near `)'
(tensorflow) kpmott#kevins-mbp-7 tf.olg % /opt/homebrew/Caskroom/miniforge/base/envs/tensorflow/lib/python3.9/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
warnings.warn('resource_tracker: There appear to be %d '
model.fit(tf.convert_to_tensor(Σ),tf.zeros((T,output)),batch_size=T,epochs=1,verbose=0,callbacks=[TqdmCallback()])#,tbc])
zsh: parse error near `)'

Metatrader5 - Python Integration - symbol_total() returns None

I'm trying to get the number of symbols of metatrader5 and I'm getting an error
TypeError: '>' not supported between instances of 'NoneType' and 'int'
Link to the documentation: https://www.mql5.com/en/docs/integration/python_metatrader5/mt5symbolstotal_py
code:
import MetaTrader5 as mt5
print("MetaTrader5 package author: ",mt5.__author__)
print("MetaTrader5 package version: ",mt5.__version__)
if not mt5.initialize():
print("initialize() failed, error code =",mt5.last_error())
quit()
symbols=mt5.symbols_total()
if symbols>0:
print("Total symbols =",symbols)
else:
print("symbols not found")
mt5.shutdown()
The problem is that the function is returning NoneType instead of a number.
Why it's returning a NoneType? How can i get the list of Symbols/Stocks?
Any clue?
I had the same problem too. If you are currently using a downloaded MT5 terminal from your broker, you can try using the official MT5 terminal instead. That seemed to have fixed my issue. Don't forget to specify the path to the correct MT5 terminal.exe afterwards within the initialization function initialize(path=...).
As to why this was causing an issue, I'm unsure myself. I happened across this post and it mentioned that there may have been modifications made by brokers.
Anyway, hope this works for you too!
To connect to your broker's server afterwards, within the MT5 terminal under Navigator->Accounts (Right Click)->Open an account->Search for your broker and enter your credentials.

Gurobi/Python crashes with "A heap has been corrupted" error message

I am running an optimization in Gurobi which crashes whenever I add a quadratic constraint to the problem that I generate thru the following lines of code:
expression = gurobipy.QuadExpr()
for course_key in hostings:
for kitchen_key in hostings[course_key]:
if not hostings[course_key][kitchen_key].large_gathering:
expression.add(x[kitchen_key,course_key,team_key1]*x[kitchen_key,course_key,team_key2])
mod.addQConstr(expression,gurobipy.GRB.LESS_EQUAL,1,"1MeetingPerPair_"+team_key1+"_"+team_key2)
The optimization always crashes after three iterations:
cmd output
with the following error message:
Unhandled exception at 0x00007FFC596CE6FC (ntdll.dll) in python.exe:
0xC0000374: A heap has been corrupted (parameters: 0x00007FF8FF82C6E0).
Does anyone have any clue as to how this problem could be solved? I am rather clueless as to what the error message even wants to tell me. I tried constructing the constraint in different ways (e. g. using .add instead of .addTerms) but that didn't change anything. Appreciate any help!

U-SQL, Python, local execution, "device not found" error

I'm trying to run a U-SQL job with Python extension locally using VS 2017.
I followed these steps:
https://1drv.ms/w/s!AvdZLquGMt47g0NultCKgm38sejs
https://blogs.msdn.microsoft.com/azuredatalake/2017/02/20/enabling-u-sql-advanced-analytics-for-local-execution/
And then I tried to run this:
https://learn.microsoft.com/en-us/azure/data-lake-analytics/data-lake-analytics-u-sql-python-extensions
It works fine if I run it in Azure, but if I try to run it locally, the error I get is: "The device is not read".
Details:
Start : 2017-08-16 14:35:13
Initialize : 2017-08-16 14:35:13
GraphParse : 2017-08-16 14:35:13
Run : 2017-08-16 14:35:13
Start 'Root' : 2017-08-16 14:35:13
End 'Root(Success)' : 2017-08-16 14:35:13
Start '1_SV1_Extract' : 2017-08-16 14:35:13
End '1_SV1_Extract(Error)' : 2017-08-16 14:35:14
Completed with 'Error' : 2017-08-16 14:35:14
Execution failed with error '1_SV1_Extract Error : '{"diagnosticCode":195887147,"severity":"Error","component":"RUNTIME","source":"User","errorId":"E_RUNTIME_USER_UNHANDLED_EXCEPTION_FROM_USER_CODE","message":"An unhandled exception from user code has been reported","description":"Unhandled exception from user code: \"The device is not ready.\r\n\"\nThe details includes more information including any inner exceptions and the stack trace where the exception was raised.","resolution":"Make sure the bug in the user code is fixed.","helpLink":"","details":"==== Caught exception System.IO.IOException\n\n at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\r\n at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)\r\n at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)\r\n at System.IO.Compression.ZipFileExtensions.ExtractToDirectory(ZipArchive source, String destinationDirectoryName)\r\n at System.IO.Compression.ZipFile.ExtractToDirectory(String sourceArchiveFileName, String destinationDirectoryName, Encoding entryNameEncoding)\r\n at Microsoft.MetaAnalytics.LanguageWorker.UsqlPyExecution.LocatePython(String version) in C:\\Users\\shravan\\Source\\Repos\\VSTS\\USqlExtensions\\lang\\python\\AFx\\Product\\Source\\Modules\\LanguageWorker\\LanguageWorker.Dll\\UsqlExecution.cs:line 146\r\n at Microsoft.MetaAnalytics.LanguageWorker.UsqlPyExecution.InvokeLanguage(String version, String scriptname, IList`1 infiles, IList`1 outfiles, IObserver`1 stringLogger) in C:\\Users\\shravan\\Source\\Repos\\VSTS\\USqlExtensions\\lang\\python\\AFx\\Product\\Source\\Modules\\LanguageWorker\\LanguageWorker.Dll\\UsqlExecution.cs:line 89\r\n at Microsoft.MetaAnalytics.LanguageWorker.UsqlPyExecution.Run(IRowset input, IUpdatableRow output, String script, String version) in C:\\Users\\shravan\\Source\\Repos\\VSTS\\USqlExtensions\\lang\\python\\AFx\\Product\\Source\\Modules\\LanguageWorker\\LanguageWorker.Dll\\UsqlExecution.cs:line 42\r\n at Extension.Python.Reducer.<Reduce>d__6.MoveNext() in C:\\Users\\shravan\\Source\\Repos\\VSTS\\USqlExtensions\\lang\\python\\ExtPy\\PyReducer.cs:line 56\r\n at ScopeEngine.SqlIpReducer<Extract_0_Data0,Process_1_Data0,ScopeEngine::KeyComparePolicy<Extract_0_Data0,3> >.GetNextRow(SqlIpReducer<Extract_0_Data0\\,Process_1_Data0\\,ScopeEngine::KeyComparePolicy<Extract_0_Data0\\,3> >* , Process_1_Data0* output) in c:\\users\\e\\source\\repos\\usqlapplication1\\usqlapplication1\\bin\\debug\\1b720f51a8b3caea\\script_fe316531c87f021f\\sqlmanaged.h:line 2788\r\n at std._Func_class<void>.()(_Func_class<void>* )\r\n at RunAndHandleClrExceptions(function<void __cdecl(void)>* code)","internalDiagnostics":""}
'
'
Execution failed !
I'm aware that the blog post mentions that running Python extensions locally is not officially supported, but they do make it sound like it should at least be possible somehow?
I don't get any errors if I run U-SQL scripts without using the Python extension locally.
Is there anything I'm missing? Is there any logging I could turn on to find out more? Has anyone had success running Python with U-SQL locally?
(Azure Data Lake team here)
There was a recent update in how the Python distribution is located in the Azure Data Lake Analytics service. While the change improved vertex startup times, it also broke some basic assumptions on how local execution of U-SQL scripts works.
The team is working on an alternative solution that will let a locally executing U-SQL script use an existing Python distribution that is installed on the same local machine.

fast-r-cnn: caffe.LayerParameter" has no field named "roi_pooling_param

When I tried to run ./tools/demo.py of fast-r-cnn. working on UBUNTU 16.04
I got the following error, although the caffe is successfully installed!!
./tools/demo.py
WARNING: Logging before InitGoogleLogging() is written to STDERR
W0823 14:12:46.105280 4444 _caffe.cpp:122] DEPRECATION WARNING - deprecated use of Python interface
W0823 14:12:46.105316 4444 _caffe.cpp:123] Use this instead (with the named "weights" parameter):
W0823 14:12:46.105319 4444 _caffe.cpp:125] Net('/home/hana/Documents/try/fast-rcnn-master/models/VGG16/test.prototxt', 1, weights='/home/hana/Documents/try/fast-rcnn-master/data/fast_rcnn_models/vgg16_fast_rcnn_iter_40000.caffemodel')
[libprotobuf ERROR google/protobuf/text_format.cc:274] Error parsing text-format caffe.NetParameter: 392:21: Message type "caffe.LayerParameter" has no field named "roi_pooling_param".
F0823 14:12:46.106595 4444 upgrade_proto.cpp:79] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: /home/hana/Documents/try/fast-rcnn-master/models/VGG16/test.prototxt
*** Check failure stack trace: ***
Aborted (core dumped)
Please any help?
Faster-RCNN requires its own branch of caffe. This branch includes roi_pooling_layer and its associated parameters.
Follow the installation instructions of Faster RCNN to get the correct branch of caffe.

Categories