Up numpy と h5py のバージョン変更の経緯 作成: 2021-05-04
更新: 2021-05-04


    (venv) $ python convert_weights.py --tiny 2021-05-04 16:20:35.736038: E tensorflow/core/platform/hadoop/hadoop_file_system.cc:132] HadoopFileSystem load error: libhdfs.so: cannot open shared object file: No such file or directory WARNING:tensorflow:From convert_weights.py:137: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead. WARNING:tensorflow:From /home/pi/Tensorflow-YOLOv3/core/yolo_tiny.py:76: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead. WARNING:tensorflow:From /home/pi/Tensorflow-YOLOv3/core/layers.py:25: The name tf.layers.Conv2D is deprecated. Please use tf.compat.v1.layers.Conv2D instead. WARNING:tensorflow:From /home/pi/Tensorflow-YOLOv3/core/layers.py:34: The name tf.layers.BatchNormalization is deprecated. Please use tf.compat.v1.layers.BatchNormalization instead. WARNING:tensorflow:From /home/pi/Tensorflow-YOLOv3/core/layers.py:41: The name tf.layers.MaxPooling2D is deprecated. Please use tf.compat.v1.layers.MaxPooling2D instead. Traceback (most recent call last): File "convert_weights.py", line 157, in <module> main(args.tiny) File "convert_weights.py", line 138, in main model(inputs) File "/home/pi/Tensorflow-YOLOv3/core/yolo_tiny.py", line 88, in __call__ data_format=self.data_format) File "/home/pi/Tensorflow-YOLOv3/core/layers.py", line 70, in yolo_layer x_offset, y_offset = tf.meshgrid(x, y) File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_core/python/ops/array_ops.py", line 3065, in meshgrid mult_fact = ones(shapes, output_dtype) File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_core/python/ops/array_ops.py", line 2659, in ones output = _constant_if_small(one, shape, dtype, name) File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_core/python/ops/array_ops.py", line 2393, in _constant_if_small if np.prod(shape) < 1000: File "<__array_function__ internals>", line 6, in prod File "/home/pi/venv/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 3031, in prod keepdims=keepdims, initial=initial, where=where) File "/home/pi/venv/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 87, in _wrapreduction return ufunc.reduce(obj, axis, dtype, out, **passkwargs) File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 730, in __array__ " array.".format(self.name)) NotImplementedError: Cannot convert a symbolic Tensor (yolov3_tiny/meshgrid/Size_1:0) to a numpy array. ----------------------------------------------------------------------------------- (venv) $ pip show numpy ‥‥ Version: 1.20.2 ‥‥ (venv) $ pip uninstall numpy (venv) $ pip install numpy==1.19.5 ----------------------------------------------------------------------------------- (venv) $ python convert_weights.py --tiny 2021-05-04 16:44:00.521313: E tensorflow/core/platform/hadoop/hadoop_file_system.cc:132] HadoopFileSystem load error: libhdfs.so: cannot open shared object file: No such file or directory Traceback (most recent call last): File "convert_weights.py", line 2, in <module> import tensorflow as tf File "/home/pi/venv/lib/python3.7/site-packages/tensorflow/__init__.py", line 98, in <module> from tensorflow_core import * File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_core/__init__.py", line 28, in <module> from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "<frozen importlib._bootstrap>", line 1019, in _handle_fromlist File "/home/pi/venv/lib/python3.7/site-packages/tensorflow/__init__.py", line 50, in __getattr__ module = self._load() File "/home/pi/venv/lib/python3.7/site-packages/tensorflow/__init__.py", line 44, in _load module = _importlib.import_module(self.__name__) File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_core/python/__init__.py", line 88, in <module> from tensorflow.python import keras File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_core/python/keras/__init__.py", line 26, in <module> from tensorflow.python.keras import activations File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_core/python/keras/__init__.py", line 26, in <module> from tensorflow.python.keras import activations File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_core/python/keras/activations.py", line 23, in <module> from tensorflow.python.keras.utils.generic_utils import deserialize_keras_object File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_core/python/keras/utils/__init__.py", line 34, in <module> from tensorflow.python.keras.utils.io_utils import HDF5Matrix File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_core/python/keras/utils/io_utils.py", line 30, in <module> import h5py File "/home/pi/venv/lib/python3.7/site-packages/h5py/__init__.py", line 25, in <module> from . import _errors File "h5py/_errors.pyx", line 1, in init h5py._errors ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 44 from C header, got 40 from PyObject ----------------------------------------------------------------------------------- (venv) $ pip show h5py  ‥‥ Version: 3.2.1  ‥‥ (venv) $ pip uninstall h5py (venv) $ pip install h5py==2.10.0 ----------------------------------------------------------------------------------- (venv) $ python convert_weights.py --tiny 2021-05-04 16:56:39.811032: E tensorflow/core/platform/hadoop/hadoop_file_system.cc:132] HadoopFileSystem load error: libhdfs.so: cannot open shared object file: No such file or directory Traceback (most recent call last): File "convert_weights.py", line 2, in <module> import tensorflow as tf File "/home/pi/venv/lib/python3.7/site-packages/tensorflow/__init__.py", line 98, in <module> from tensorflow_core import * File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_core/__init__.py", line 36, in <module> from ._api.v1 import compat File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_core/_api/v1/compat/__init__.py", line 23, in <module> from . import v1 File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_core/_api/v1/compat/v1/__init__.py", line 673, in <module> from tensorflow_estimator.python.estimator.api._v1 import estimator File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_estimator/__init__.py", line 8, in <module> from tensorflow_estimator._api.v1 import estimator File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_estimator/_api/v1/estimator/__init__.py", line 8, in <module> from tensorflow_estimator._api.v1.estimator import experimental File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_estimator/_api/v1/estimator/experimental/__init__.py", line 8, in <module> from tensorflow_estimator.python.estimator.canned.dnn import dnn_logit_fn_builder File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/__init__.py", line 25, in <module> import tensorflow_estimator.python.estimator.estimator_lib File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator_lib.py", line 53, in <module> from tensorflow_estimator.python.estimator.inputs import inputs File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/inputs/inputs.py", line 22, in <module> from tensorflow_estimator.python.estimator.inputs.numpy_io import numpy_input_fn File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/inputs/numpy_io.py", line 26, in <module> from tensorflow_estimator.python.estimator.inputs.queues import feeding_functions File "/home/pi/venv/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/inputs/queues/feeding_functions.py", line 40, in <module> import pandas as pd File "/home/pi/venv/lib/python3.7/site-packages/pandas/__init__.py", line 29, in <module> from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib File "/home/pi/venv/lib/python3.7/site-packages/pandas/_libs/__init__.py", line 13, in <module> from pandas._libs.interval import Interval File "pandas/_libs/interval.pyx", line 1, in init pandas._libs.interval ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 44 from C header, got 40 from PyObject ----------------------------------------------------------------------------------- (venv) $ pip uninstall numpy (venv) $ pip install numpy (venv) $ pip show numpy ‥‥ Version: 1.16.2 ‥‥ ----------------------------------------------------------------------------------- (venv) $ python convert_weights.py --tiny 2021-05-04 17:01:34.426535: E tensorflow/core/platform/hadoop/hadoop_file_system.cc:132] HadoopFileSystem load error: libhdfs.so: cannot open shared object file: No such file or directory WARNING:tensorflow:From convert_weights.py:137: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead. WARNING:tensorflow:From /home/pi/Tensorflow-YOLOv3/core/yolo_tiny.py:76: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead. WARNING:tensorflow:From /home/pi/Tensorflow-YOLOv3/core/layers.py:25: The name tf.layers.Conv2D is deprecated. Please use tf.compat.v1.layers.Conv2D instead. WARNING:tensorflow:From /home/pi/Tensorflow-YOLOv3/core/layers.py:34: The name tf.layers.BatchNormalization is deprecated. Please use tf.compat.v1.layers.BatchNormalization instead. WARNING:tensorflow:From /home/pi/Tensorflow-YOLOv3/core/layers.py:41: The name tf.layers.MaxPooling2D is deprecated. Please use tf.compat.v1.layers.MaxPooling2D instead. WARNING:tensorflow:From /home/pi/Tensorflow-YOLOv3/core/layers.py:97: The name tf.image.resize_nearest_neighbor is deprecated. Please use tf.compat.v1.image.resize_nearest_neighbor instead. WARNING:tensorflow:From convert_weights.py:139: The name tf.global_variables is deprecated. Please use tf.compat.v1.global_variables instead. Loading weights from "./weights/yolov3-tiny.weights" WARNING:tensorflow:From convert_weights.py:31: The name tf.assign is deprecated. Please use tf.compat.v1.assign instead. WARNING:tensorflow:From convert_weights.py:145: The name tf.train.Saver is deprecated. Please use tf.compat.v1.train.Saver instead. WARNING:tensorflow:From convert_weights.py:146: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead. 2021-05-04 17:02:03.350698: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 18874368 exceeds 10% of system memory. 2021-05-04 17:02:03.825876: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 18874368 exceeds 10% of system memory. 2021-05-04 17:02:04.129119: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 18874368 exceeds 10% of system memory. 2021-05-04 17:02:04.654812: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 18874368 exceeds 10% of system memory. 2021-05-04 17:02:05.846688: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 18874368 exceeds 10% of system memory. Model Saved at "./weights/model-tiny.ckpt" ファイル変換成功!