I've tried downloading both v3:
wget https://pjreddie.com/media/files/yolov3.weights
wget https://github.com/pjreddie/darknet/blob/master/cfg/yolov3.cfg
and v4
wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.weights
wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.cfg
but both result in similar parsing errors with OpenCV 4.5.5 ??
cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\darknet\darknet_importer.cpp:207: error: (-212:Parsing error) Failed to parse NetParameter file: yolov4.cfg in function 'cv::dnn::dnn4_v20211220::readNetFromDarknet'
though working directly from the python console and importing cv2 and then running
# Load the YOLO model
model = cv2.dnn.readNetFromDarknet("yolov4.cfg", "yolov4.weights")
seems to work - thoughts ?
Related
I have a yolov4 pre-trained model, which has been extracted in '.pb' and tflite format, while i am testing it SOM (system on module) which is ubuntu 18, i am getting following error:-
graph_def.ParseFromString(file_handle.read())
google.protobuf.message.DecodeError: Error parsing message with type 'tensorflow.GraphDef'
code is following-
with tf.gfile.GFile(checkpoint_filename, "rb") as file_handle:
graph_def = tf.GraphDef()
graph_def.ParseFromString(file_handle.read())
P.s. This is working fine on my local computer.
python 3.7.15
tensorflow 2.5.0
protobuf 3.19.1
Any help would be appreciated. Thanks!
I am trying to convert MNIST images into tensors and when I run the program I am getting the following error. I tried to re-install PyTorch but it did not help.
UserWarning: Failed to load image Python extension: Could not find module
'C:\Users\---\AppData\Roaming\Python\Python39\site-packages\torchvision\image.pyd'
(or one of its dependencies). Try using the full path with constructor syntax.
I am trying to load spaCy model de_core_news_sm without any success. Since our company police seems to block the python -m spacy download de_core_news_sm prompt command, I downloaded the model manually and used pip install on the local tar.gz archive, which worked out well.
However, calling nlp = spacy.load("de_core_news_sm") in my code throws the following exception:
Exception has occurred: ValueError
[E149] Error deserializing model. Check that the config used to create the
component matches the model being loaded.
File "pipes.pyx", line 642, in
spacy.pipeline.pipes.Tagger.from_disk.load_model
I have no idea how to deal with this. Does anybody know what to do?
Run python -m spacy validate to check whether the model you downloaded is compatible with the version of spacy you have installed. This kind of error happens when the versions aren't compatible. (Probably one is v2.1 and the other is v2.2.)
Background:
Purpose is to develop a machine learning algorithm involving tensorflow.
Problem:
Importing tensorflow results in the error: "invalid proto descriptor for file "tensorboard/compat/proto/resource_handle.proto"" (see error log after my code at the end.)
Action taken:
Tried running pip uninstall protobuf. Next, pip install --no-binary protobuf protobuf.
But, that creates a second error that there is "no google protobuf. If I install protobufs I run into the first error again.
Platform:
Ubuntu 18.10, v 64 bit forGPU. Python 3.6.8.
My Code:
import tensorflow-nightly-gpu #(regardless of version of tf I get the error)
import pandas as pd
...
Error Log:
Couldn't build proto file into descriptor pool!
Invalid proto descriptor for file
"tensorboard/compat/proto/resource_handle.proto":
tensorboard.ResourceHandleProto.device: "tensorboard.ResourceHandleProto.device" is already defined in file "tensorboard/src/resource_handle.proto".
tensorboard.ResourceHandleProto.container: "tensorboard.ResourceHandleProto.container" is already defined in file "tensorboard/src/resource_handle.proto".
tensorboard.ResourceHandleProto.name: "tensorboard.ResourceHandleProto.name" is already defined in file "tensorboard/src/resource_handle.proto".
tensorboard.ResourceHandleProto.hash_code: "tensorboard.ResourceHandleProto.hash_code" is already defined in file "tensorboard/src/resource_handle.proto".
tensorboard.ResourceHandleProto.maybe_type_name: "tensorboard.ResourceHandleProto.maybe_type_name" is already defined in file "tensorboard/src/resource_handle.proto".
Solved my own problem with these steps:
1.Remove all existing GPU, CUDA, CUDNN drivers and remove all tensorflow from my computer
Install drivers for GPU, CUDA, CUDNN with instructions here, https://www.tensorflow.org/install/gpu
Install tensorflow from here, phttps://www.tensorflow.org/install/pip
I am attempting to use Tabula to pull table information from a pdf and convert it to a pandas dataframe. I have been following the steps in this tutorial:
https://aegis4048.github.io/parse-pdf-files-while-retaining-structure-with-tabula-py
When I try to load the remote PDF into my jupyter notebook with the following code (taken directly from the tutorial):
import tabula
df2 = tabula.read_pdf("https://github.com/tabulapdf/tabula-java/raw/master/src/test/resources/technology/tabula/arabic.pdf")
I get the error:
AttributeError: 'list' object has no attribute 'read'
I have tried to read in pdfs saved locally to my machine and I get the same error. I believe I have successfully installed Java and configured the environment variable correctly, and I have the most recent version of Tabula.
Link to screenshot from my jupyter notebook:
https://www.dropbox.com/s/y44mfzuclihfdau/S_O_Capture_1.PNG?dl=0
Thanks.
Make sure you installed the right tabula package!
If you ran pip3 install tabula, then you installed an imposter!
Run pip3 uninstall tabula to remove it, then run:
pip3 install tabula-py
to install the correct package.