0

I am following this tutorial YOLOv4 Object Detection with TensorFlow

while running this script

# Convert darknet weights to tensorflow
## yolov4
python save_model.py --weights ./data/yolov4.weights --output ./checkpoints/yolov4-416 --input_size 416 --model yolov4 

I am getting this error

C:\tensorflow-yolov4-tflite-master>python save_model.py --weights ./data/yolov4-obj_3000.weights --output ./checkpoints/yolov4-416 --input_size 416 --model yolov4
Traceback (most recent call last):
  File "save_model.py", line 1, in <module>
    import tensorflow as tf
  File "C:\Users\hp\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "C:\Users\hp\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\__init__.py", line 40, in <module>
    from tensorflow.python.eager import context
  File "C:\Users\hp\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\eager\context.py", line 35, in <module>
    from tensorflow.python import pywrap_tfe
  File "C:\Users\hp\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\pywrap_tfe.py", line 28, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\hp\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 28, in <module>
    self_check.preload_check()
  File "C:\Users\hp\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\platform\self_check.py", line 61, in preload_check
    % " or ".join(missing))
ImportError: Could not find the DLL(s) 'msvcp140.dll or msvcp140_1.dll'. TensorFlow requires that these DLLs be installed in a
directory that is named in your %PATH% environment variable. You may install these DLLs by downloading "Microsoft C++ 
Redistributable for Visual Studio 2015, 2017 and 2019" for your platform from 
this URL: https://support.microsoft.com/help/2977003/the-latest-supported-visual-c-downloads

I have tried solving it by manually downloading these files and placing them in C:\Users\hp\AppData\Local\Programs\Python\Python37

and re-installing microsoft c++ 2015 redistributable x64 as mentioned in Tensorflow - ImportError: Could not find 'msvcp140.dll' but to no avail.

my TensorFlow installation is Cpu based

C:\>pip show tensorflow
Name: tensorflow
Version: 2.3.0rc0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: packages@tensorflow.org
License: Apache 2.0
Location: c:\users\hp\appdata\local\programs\python\python37\lib\site-packages
Requires: termcolor, scipy, keras-preprocessing, grpcio, absl-py, six, opt-einsum, numpy, google-pasta, protobuf, wheel, h5py, gast, tf-estimator-nightly, wrapt, tensorboard, astunparse
Required-by:
James Z
  • 12,209
  • 10
  • 24
  • 44
Mueez Khan
  • 107
  • 3
  • 11

1 Answers1

0

I have dealt with the exact problem , Search the file name in google you will get the correct file ,Download it the site you are downloading from will show you the path to paste that folder too ; If your not able to get that file i can provide you the corresponding dll files download links too...

brown
  • 31
  • 1
  • 7
  • i am using this link (https://www.dll-files.com/msvcp140.dll.html) , can you please tell me where **the path to paste that folder too** is told. – Mueez Khan May 28 '21 at 16:35
  • 1
    @MueezKhan Sorry for the delay , Extract the folders ,Copy the .DLL file to your C:\Windows\System32\ folder. ( 32 bit) Copy the .DLL file to your C:\Windows\SysWOW64\ folder. ( 64 bit) – brown May 29 '21 at 03:37
  • thanks for your response, re installing microsoft c++ 2015 redistributable x64, was tge thing that eventually worked for me. – Mueez Khan Jul 03 '21 at 13:53