Code Monkey home page Code Monkey logo

Comments (8)

ScorpioCPH avatar ScorpioCPH commented on August 19, 2024

@saselovejulie
脚本里面,最前面加上下面这句试下:

# coding=utf-8

from tensorflow-tutorial.

saselovejulie avatar saselovejulie commented on August 19, 2024

@ScorpioCPH
加上了还是有这个issue, 麻烦有时间看看.谢谢
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

from tensorflow-tutorial.

saselovejulie avatar saselovejulie commented on August 19, 2024

1500553139

from tensorflow-tutorial.

ScorpioCPH avatar ScorpioCPH commented on August 19, 2024

试一下下面这个代码,测试过可以正常工作:

# coding=utf-8

import tensorflow as tf

# cat.jpg 放到相同目录
image_raw_data = tf.gfile.FastGFile("./cat.jpg",'r').read()

with tf.Session() as sess:
    img_data = tf.image.decode_jpeg(image_raw_data)
    
    # 输出解码之后的三维矩阵
    print 'img_data: ', img_data.eval()
    img_data.set_shape([1797, 2673, 3])
    print 'img_shape: ', img_data.get_shape()

PS,你用的 python 2 还是 3

from tensorflow-tutorial.

ScorpioCPH avatar ScorpioCPH commented on August 19, 2024

@saselovejulie

from tensorflow-tutorial.

saselovejulie avatar saselovejulie commented on August 19, 2024

@ScorpioCPH
谢谢, 我试试.
我是Python3.5

from tensorflow-tutorial.

saselovejulie avatar saselovejulie commented on August 19, 2024

@ScorpioCPH
你给我的代码还是改成rb, 看来是python版本问题...
thanks

from tensorflow-tutorial.

ScorpioCPH avatar ScorpioCPH commented on August 19, 2024

我用的 python 2.7,那可能是版本的问题

from tensorflow-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.