I have been referred to this platform from Stackoverflow for this question
I am trying to follow this video: https://www.youtube.com/watch?v=_UqmgHKdntU
I cloned the github repository, and then I downloaded the weight files. I also created a virtual environment with python 3.6.0
(because Python 3.9.2 was giving error due to incomaptibility with Tensorflow version 2.2 which was in the requirements.txt
file)
However, when I tried to load the weights with the following command,
python load_weights.py
I am getting this error,
__version__ = __version_info__.__version__
AttributeError: 'version_info' object has no attribute '__version__'
I tried to find this a lot on Stackoverflow and other places on Google but could not find anything that worked for me.
The complete error is given below,
File "load_weights.py", line 4, in <module>
from yolov3_tf2.models import YoloV3, YoloV3Tiny
Traceback (most recent call last):
File "load_weights.py", line 4, in <module>
from yolov3_tf2.models import YoloV3, YoloV3Tiny
File "E:Example4Object-Detection-APIyolov3_tf2models.py", line 23, in <module>
from .utils import broadcast_iou
File "E:Example4Object-Detection-APIyolov3_tf2utils.py", line 5, in <module>
from seaborn import color_palette
File "E:Example4Object-Detection-APIvenvlibsite-packagesseaborn__init__.py", line 2, in <module>
from .rcmod import * # noqa: F401,F403
File "E:Example4Object-Detection-APIvenvlibsite-packagesseabornrcmod.py", line 5, in <module>
import matplotlib as mpl
File "E:Example4Object-Detection-APIvenvlibsite-packagesmatplotlib__init__.py", line 107, in <module>
from . import cbook, rcsetup
File "E:Example4Object-Detection-APIvenvlibsite-packagesmatplotlibrcsetup.py", line 28, in <module>
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
File "E:Example4Object-Detection-APIvenvlibsite-packagesmatplotlibfontconfig_pattern.py", line 15, in <module>
from pyparsing import (Literal, ZeroOrMore, Optional, Regex, StringEnd,
File "E:Example4Object-Detection-APIvenvlibsite-packagespyparsing__init__.py", line 130, in <module>
__version__ = __version_info__.__version__
AttributeError: 'version_info' object has no attribute '__version__'
One of the solutions on Stackoverflow told me to change pyparsing
library, https://stackoverflow.com/questions/69964466/unknown-version-in-python-library-pyparsing
I checked the pyparsing version using the command pip show pyparsing
, which displayed the following results,
WARNING: Ignoring invalid distribution -ensorflow (e:hassanexample4object-detection-apivenvlibsite-packages)
Name: pyparsing
Version: 3.0.7
Summary: Python parsing module
Home-page: https://github.com/pyparsing/pyparsing/
Author: Paul McGuire
Author-email: ptmcg.gm+pyparsing@gmail.com
License: MIT License
Location: e:example4object-detection-apivenvlibsite-packages
Requires:
Required-by: matplotlib
After which I tried to install the pyparsing version 3.0.7
using the command pip install pyparsing==3.0.7
, however I got this message,
Requirement already satisfied: pyparsing==3.0.7 in e:example4object-detection-apivenvlibsite-packages (3.0.7)
WARNING: You are using pip version 21.3.1; however, version 22.0.3 is available.
You should consider upgrading via the 'E:Example4Object-Detection-APIvenvScriptspython.exe -m pip install --upgrade pip' command.
I also tried to uninstall the pyparsing and again install the specified version, but the problem still persisted.
Another solution asked me to also install the tensorflow-gpu
which was given on the Github repository,
pip install -r requirements-gpu.txt
I tried this however this also did not work. I also tried to uninstall and install Tensorflow again, but again the same error persisted.
I also tried to upgrade my pip by using this,
python -m pip install --upgrade pip
This showed me the message that,
Requirement already satisfied: pip in e:hassansemester 8researchexample4object-detection-apivenvlibsite-packages (21.3.1)
However, at the end, it said that new version is still available (but it wouldn’t install it, I don’t know for what reason)
WARNING: You are using pip version 21.3.1; however, version 22.0.3 is available.
You should consider upgrading via the 'E:Example4Object-Detection-APIvenvScriptspython.exe -m pip install --upgrade pip' command.
According to one of the posts, upgrading pip solves the problem. I tried to upgrade but it neither upgraded the pip version nor did it solve my problem.
Can anyone help me solve this version
error?