GithubHelp home page GithubHelp logo

Comments (8)

weinman avatar weinman commented on June 1, 2024

Thanks for the note! If you find enough other places that vary significantly for Python 3, I'd be happy to have a separate branch that contains updates for Python3 , and I'd merge it with master if it works in both Python2 and Python3.

In any case, several of the jpg files in the raw mjsynth archive are just garbage. You can verify this by trying to load them in any image viewer (they might be truncated, but they tend to be only a handful of bytes relative to the valid images).

I don't know why that is, but the way the TFRecord encoder handles this is to detect the exception inevitably thrown by the image file decoder and let you know know about it whilst moving on to another example.

from cnn_lstm_ctc_ocr.

Kumara-Kaushik avatar Kumara-Kaushik commented on June 1, 2024

Thanks for the prompt reply, the problem is, all I see are errors when reading the files. I'll try once in python 2 and see if I get the same error.

from cnn_lstm_ctc_ocr.

Hust-ShuaiWang avatar Hust-ShuaiWang commented on June 1, 2024

Did you run this code on a Windows system?

from cnn_lstm_ctc_ocr.

weinman avatar weinman commented on June 1, 2024

@Hust-ShuaiWang I'm not sure whether you're asking me or @Kumara-Kaushik, but I can tell you that I did not run any of this repo on a Windows system. Are you suggesting that the problems with bad input data do not occur on a Windows-based file system?

from cnn_lstm_ctc_ocr.

Hust-ShuaiWang avatar Hust-ShuaiWang commented on June 1, 2024

I am asking for @Kumara-Kaushik .I have met the same error when I run this repo on a Windows system.The reason for this problem is that the file has different storage formats on WINDOWS and LINUX.So you have to change the way you read the file.Just change the "with tf.gfile.FastGFile( filename, 'r' ) as f:" to "with tf.gfile.FastGFile( filename, 'rb' ) as f:" (line 133 in mjsynth-tfrecord.py).Detailed error reason, you have to find relevant information yourself, not difficult

from cnn_lstm_ctc_ocr.

weinman avatar weinman commented on June 1, 2024

@Hust-ShuaiWang Thanks for the report. I'll try out that change on Linux, and if it works there too, I will commit it.

from cnn_lstm_ctc_ocr.

david-morris avatar david-morris commented on June 1, 2024

@weinman I can confirm @Hust-ShuaiWang 's technique. I think it works because the 'b' signifies bytes, and the default file opening mode is as text now.

from cnn_lstm_ctc_ocr.

weinman avatar weinman commented on June 1, 2024

Updated in defd8ae

from cnn_lstm_ctc_ocr.

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.