• EnglishSpanishGermanFrenchPolishChinese (Traditional)


EnglishSpanishGermanFrenchPolishChinese (Traditional)

Operating systems, scripting, PowerShell and security

Operating systems, software development, scripting, PowerShell tips, network and security

Menú principal
  • Categorías
  • Cursos
  • Libro de PowerShell
  • Lo mejor
  • Lo último
  • Proyectos
  • Contactar
Ir al contenido

¿Cómo solucionar el error «Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2» utilizando TensorFlow?

Si estamos ejecutando el código del modelo entrenado para identificar imagenes de Github https://raw.githubusercontent.com/tensorflow/models/master/tutorials/image/imagenet/classify_image.py

Hay que añadir al fichero classify_image.py las siguientes líneas:

Python
1
2
3
# Just disables the warning, doesn't enable AVX/FMA
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'

El resultado es el siguiente:

Python
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
 
import argparse
import os.path
import re
import sys
import tarfile
 
import numpy as np
from six.moves import urllib
import tensorflow as tf
 
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'

Después de añadir y guardar ya no vuelve a dar error el script en Python.

Publicado el día 3 de febrero de 2020

CATEGORÍAS

Python, Reconocimiento

ETIQUETAS

Código, GitHub, HTTPS, Jesús Niño, Jesús Niño Camazón, Path, TensorFlow

MÁS

  • Cambiar el tamaño a una imagen con Python Imaging Library (PIL)
  • Ampliar el tamaño a una imagen con Python Imaging Library (PIL)
  • Extraer datos de varias imágenes de un vídeo MP4 mediante el reconocimiento óptico de caracteres y el análisis de imágenes con TensorFlow
  • Reducir el tamaño a una imagen con Python Imaging Library (PIL)
  • Realizar operaciones automáticas en LinkedIn
  • Automatizar desde Python