Error after predicting using CNN model loaded from disk - deep-learning

I loaded my CNN model using
model = load_model('./model/model.h5')
This model loads well ( Though I do get warning messages: "Call initializer instance with the dtype argument instead of passing it to the constructor" )
However, when I try to predict using this model, I get the following error:
UnknownError: 2 root error(s) found.
(0) Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.
[[{{node conv2d/Conv2D}}]]
[[dense_2/Softmax/_273]]
(1) Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.
[[{{node conv2d/Conv2D}}]]
0 successful operations.
0 derived errors ignored
Any idea how to overcome this issue?

Apparently, I just didn't have CUDA installed on my system. Did that and now it's working!

Related

CUDA Error: out of memory (Yolov4 custom model training)

I am trying to train a custom model on weights in the darknet and the algorithm involved is yolov4. After the model is successfully loaded, I am getting a Cuda error: out of memory as shown below.
896 x 896
Create 6 permanent cpu-threads
Try to set subdivisions=64 in your cfg-file.
CUDA status Error: file: D:\darknet\src\dark_cuda.c : cuda_make_array() : line: 492 :
build time: Jan 21 2022 - 16:57:15
CUDA Error: out of memory
As suggested in the error I even changed my subdivision=64 in the configuration file, but still I am getting the same error. I have tried various combinations of batch and subdivisions,but I am unable to solve this issue.
I am using cuda version:10.1 and nvidia-gtx1050.
A snapshot of my configuration file:

How to determine the state of peer access without producing a warning in cuda-memcheck

In a multi-gpu system, I use the return value of
cudaError_t cudaDeviceDisablePeerAccess ( int peerDevice ) to determine if peer access is disabled. In that case, the function returns cudaErrorPeerAccessNotEnabled
This is not an error in my program, but produces a warning in both cuda-gdb and cuda-memcheck since an API call did not return cudaSuccess.
In the same manner cudaDeviceEnablePeerAccess returns cudaErrorPeerAccessAlreadyEnabled if access has already been enabled.
How can one find out if peer access is enabled / disabled without producing a warning?
Summarizing comments into an answer: you can't.
The runtime API isn't blessed with the ability to have informational/warning level status returns and error returns. Everything which isn't success is treated as an error. And the toolchain utilities like cuda-memcheck cannot be instructed to ignore errors. The default beahaviour is to report and continue, so it will not interfere with anything, but it will emit an error message.
If you want to avoid the errors then you will need to build some layers of your own state tracking and condition preemption to avoid potential errors being returned.

Regarding caffe caffe.paramspec has no parameter named compression

I was trying to run a customized model on caffe.Unfortunately,I was only provided with a trainval.prototxt and trainval.caffemodel.
The exact error is as follows
Error parsing text-format caffe.NetParameter: 54:17: Message type “caffe.ParamSpec has no field named compression
This is followed by
[upgrade_proto.cpp :79] check failed read protofromtextfile failed to parse param file
A similar question was asked here.
So should I assume that my version of caffe that I have on my system was different from the client's version of caffe and apparently the client version of caffe has a slightly different proto definition??

Access violation, NotEnemy is 0xBF800000

I use cocos2d-x to do the game. After running my program for a while, the variable "NotEnemy" will always report the "access violation" error. NotEnemy is the variable I set in EventListenerPhysicsContact, always using cocos2d-x There will be errors like the title, all I want to know when there is such a mistake, is there any solution, I hope someone can tell me, right, NotEnemy I am assigned this way, auto NotEnemy=contact.getShapeB( )->getBody()->getNode();
I tried setting it to nullptr after using NotEnemy, but it didn't work. Now it generates a new error "Exception at 0x76EE35D2 (located in TankBattle.exe): Microsoft C++ Exception: std::exception, in memory Location 0x00C5F548.
There is an unhandled exception at 0x7640E6EB (ucrtbase.dll) (in TankBattle.exe): A critical program exit has been requested. ", used to be an error about access permissions conflicts, but they are all problems with NotEnemy, and they all appear in the "NotEnemy->SetPosition(Vec2(166,14))" statement.

Why are the layer weights null and TRT not finding cache when trying to run nvidia's tutorial code on Jetson TX2?

I'm trying to run the tutorial code from nvidia's repo here.
Here's what happens with the console imagenet program on my Jetson TX2:
nvidia#tegra-ubuntu:~/jetson-inference/build/aarch64/bin$ ./imagenet-console orange_0.pjg output_0.jpg
imagenet-console
args (3): 0 [./imagenet-console] 1 [orange_0.pjg] 2 [output_0.jpg]
imageNet -- loading classification network model from:
-- prototxt networks/googlenet.prototxt
-- model networks/bvlc_googlenet.caffemodel
-- class_labels networks/ilsvrc12_synset_words.txt
-- input_blob 'data'
-- output_blob 'prob'
-- batch_size 2
[TRT] TensorRT version 4.0.2
[TRT] attempting to open cache file networks/bvlc_googlenet.caffemodel.2.tensorcache
[TRT] cache file not found, profiling network model
[TRT] platform has FP16 support.
[TRT] loading networks/googlenet.prototxt networks/bvlc_googlenet.caffemodel
Weights for layer conv1/7x7_s2 doesn't exist
[TRT] CaffeParser: ERROR: Attempting to access NULL weights
Weights for layer conv1/7x7_s2 doesn't exist
[TRT] CaffeParser: ERROR: Attempting to access NULL weights
[TRT] Parameter check failed at: ../builder/Network.cpp::addConvolution::40, condition: kernelWeights.values != NULL
error parsing layer type Convolution index 1
[TRT] failed to parse caffe network
failed to load networks/bvlc_googlenet.caffemodel
failed to load networks/bvlc_googlenet.caffemodel
imageNet -- failed to initialize.
imagenet-console: failed to initialize imageNet
I do not have Caffe installed on the Jetson board, as the tutorial specifically states that it is not needed. I'm not sure if the null weights error would be fixed if TRT would properly cache. Any ideas?
Python 2.7
Cuda 9.0
TensorRT 4.0
The corporate firewall was preventing the proper download of the models. Downloading the models manually and putting them in the networks folder solved the problem.