提交 bc16f600 编写于 作者: T Tao Luo 提交者: GitHub

Merge pull request #73 from dayhaha/fix_mnist_bug

remove matplotlib from predict.py
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
# limitations under the License. # limitations under the License.
"""Usage: predict.py -c CONF -d DATA -m MODEL """Usage: predict.py -c CONF -d DATA -m MODEL
Arguments: Arguments:
CONF train conf CONF train conf
DATA MNIST Data DATA MNIST Data
...@@ -29,7 +28,6 @@ Options: ...@@ -29,7 +28,6 @@ Options:
import os import os
import sys import sys
from docopt import docopt from docopt import docopt
import matplotlib.pyplot as plt
import numpy as np import numpy as np
from py_paddle import swig_paddle, DataProviderConverter from py_paddle import swig_paddle, DataProviderConverter
...@@ -48,6 +46,7 @@ class Prediction(): ...@@ -48,6 +46,7 @@ class Prediction():
self.network.loadParameters(model_dir) self.network.loadParameters(model_dir)
self.images, self.labels = read_data(data_dir, "t10k") self.images, self.labels = read_data(data_dir, "t10k")
self.images = self.images / 255.0 * 2.0 - 1.0 # normalized to [-1,1]
slots = [dense_vector(28 * 28)] slots = [dense_vector(28 * 28)]
self.converter = DataProviderConverter(slots) self.converter = DataProviderConverter(slots)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册