Giter Site home page Giter Site logo

Comments (9)

martin-gorner avatar martin-gorner commented on August 23, 2024 7

Try to upgrade matplotlib:
pip3 install --upgrade matplotlib

from tensorflow-mnist-tutorial.

alfonsoeromero avatar alfonsoeromero commented on August 23, 2024 4

I had the same problem, but I upgraded matplotlib to the last version via pip and it seems to work.

from tensorflow-mnist-tutorial.

martin-gorner avatar martin-gorner commented on August 23, 2024 3

The reason is that on Linux, you need to install matplotlib with apt-get because that also pulls in the graphics backend on which matplotlib relies.
But unfortunately, the version of martplotlib you get is not the freshest.

from tensorflow-mnist-tutorial.

bigwhite avatar bigwhite commented on August 23, 2024 2

after upgrading the matplotlib according to @martin-gorner advice, the problem disappeared:

$ pip3 install --upgrade matplotlib
Collecting matplotlib
  Downloading matplotlib-2.0.0-1-cp35-cp35m-manylinux1_x86_64.whl (14.7MB)
    100% |████████████████████████████████| 14.7MB 100kB/s
Collecting cycler>=0.10 (from matplotlib)
  Downloading cycler-0.10.0-py2.py3-none-any.whl
Collecting six>=1.10 (from matplotlib)
  Using cached six-1.10.0-py2.py3-none-any.whl
Collecting python-dateutil (from matplotlib)
  Downloading python_dateutil-2.6.0-py2.py3-none-any.whl (194kB)
    100% |████████████████████████████████| 194kB 322kB/s
Collecting numpy>=1.7.1 (from matplotlib)
  Using cached numpy-1.12.0-cp35-cp35m-manylinux1_x86_64.whl
Collecting pyparsing!=2.0.0,!=2.0.4,!=2.1.2,!=2.1.6,>=1.5.6 (from matplotlib)
  Downloading pyparsing-2.1.10-py2.py3-none-any.whl (56kB)
    100% |████████████████████████████████| 61kB 484kB/s
Collecting pytz (from matplotlib)
  Downloading pytz-2016.10-py2.py3-none-any.whl (483kB)
    100% |████████████████████████████████| 491kB 303kB/s
Installing collected packages: six, cycler, python-dateutil, numpy, pyparsing, pytz, matplotlib
Successfully installed cycler-0.10.0 matplotlib-2.0.0 numpy-1.12.0 pyparsing-2.1.10 python-dateutil-2.6.0 pytz-2016.10 six-1.10.0
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

from tensorflow-mnist-tutorial.

bigwhite avatar bigwhite commented on August 23, 2024 2

@martin-gorner I suggest that It is better to put the "matplotlib upgrade" step into INSTALL.txt.

from tensorflow-mnist-tutorial.

ankita-anil-verma avatar ankita-anil-verma commented on August 23, 2024 1

Collecting matplotlib
Downloading matplotlib-2.0.2-cp35-cp35m-manylinux1_x86_64.whl (14.6MB)
100% |████████████████████████████████| 14.6MB 76kB/s
Requirement already up-to-date: numpy>=1.7.1 in /usr/local/lib/python3.5/dist-packages (from matplotlib)
Collecting pyparsing!=2.0.0,!=2.0.4,!=2.1.2,!=2.1.6,>=1.5.6 (from matplotlib)
Downloading pyparsing-2.2.0-py2.py3-none-any.whl (56kB)
100% |████████████████████████████████| 61kB 2.7MB/s
Requirement already up-to-date: six>=1.10 in /usr/lib/python3/dist-packages (from matplotlib)
Collecting cycler>=0.10 (from matplotlib)
Downloading cycler-0.10.0-py2.py3-none-any.whl
Collecting python-dateutil (from matplotlib)
Downloading python_dateutil-2.6.0-py2.py3-none-any.whl (194kB)
100% |████████████████████████████████| 194kB 2.0MB/s
Collecting pytz (from matplotlib)
Downloading pytz-2017.2-py2.py3-none-any.whl (484kB)
100% |████████████████████████████████| 491kB 530kB/s
Installing collected packages: pyparsing, cycler, python-dateutil, pytz, matplotlib
Found existing installation: pyparsing 2.0.3
Not uninstalling pyparsing at /usr/lib/python3/dist-packages, outside environment /usr
Found existing installation: cycler 0.9.0
Not uninstalling cycler at /usr/lib/python3/dist-packages, outside environment /usr
Found existing installation: python-dateutil 2.4.2

Have checked it too

Requirement already up-to-date: matplotlib in /usr/local/lib/python3.5/dist-packages
Requirement already up-to-date: pyparsing!=2.0.0,!=2.0.4,!=2.1.2,!=2.1.6,>=1.5.6 in /usr/local/lib/python3.5/dist-packages (from matplotlib)
Requirement already up-to-date: pytz in /usr/local/lib/python3.5/dist-packages (from matplotlib)
Requirement already up-to-date: cycler>=0.10 in /usr/local/lib/python3.5/dist-packages (from matplotlib)
Requirement already up-to-date: python-dateutil in /usr/local/lib/python3.5/dist-packages (from matplotlib)
Requirement already up-to-date: six>=1.10 in /usr/lib/python3/dist-packages (from matplotlib)
Requirement already up-to-date: numpy>=1.7.1 in /usr/local/lib/python3.5/dist-packages (from matplotlib)

still same issue
Ankita/tfwork/try/tensorflow-mnist-tutorial$ python mnist_2.0_five_layers_sigmoid.py
Tensorflow version 1.1.0
Extracting data/train-images-idx3-ubyte.gz
Extracting data/train-labels-idx1-ubyte.gz
Extracting data/t10k-images-idx3-ubyte.gz
Extracting data/t10k-labels-idx1-ubyte.gz
Traceback (most recent call last):
File "mnist_2.0_five_layers_sigmoid.py", line 86, in
datavis = tensorflowvisu.MnistDataVis()
File "/home/tensorflow/Ankita/tfwork/try/tensorflow-mnist-tutorial/tensorflowvisu.py", line 166, in init
self._color4 = self.__get_histogram_cyclecolor(histogram4colornum)
File "/home/tensorflow/Ankita/tfwork/try/tensorflow-mnist-tutorial/tensorflowvisu.py", line 160, in __get_histogram_cyclecolor
colors = clist.by_key()['color']
AttributeError: 'Cycler' object has no attribute 'by_key'

from tensorflow-mnist-tutorial.

showforj avatar showforj commented on August 23, 2024

请问这个问题 怎么解决了

from tensorflow-mnist-tutorial.

bigwhite avatar bigwhite commented on August 23, 2024

@showforj I have commented the __get_histogram_cyclecolor invoking in init and do some hard coding to self._color4 and self._color5:

def __init__(self, title1=None, title2=None, title3=None, title4=None, title5=None, title6=None, histogram4colornum=None, histogram5colornum=None, dpi=70):
        #self._color4 = self.__get_histogram_cyclecolor(histogram4colornum)
        #self._color5 = self.__get_histogram_cyclecolor(histogram5colornum)
        self._color4 = '#CFF57F'
        self._color5 = '#E6C54A'

from tensorflow-mnist-tutorial.

gpussetto avatar gpussetto commented on August 23, 2024

Problem fixed by updating matplotlib as per martin-gorner sugestion. Thanks.

from tensorflow-mnist-tutorial.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.