Giter Site home page Giter Site logo

Comments (3)

nalakawula avatar nalakawula commented on July 20, 2024

me, too. encounter an error.

(virt) [sumarsono@mesin-arch solver]$ python2 captcha_records.py 
Looking for images in './data/train_data'
Traceback (most recent call last):
  File "captcha_records.py", line 125, in <module>
    tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
  File "/home/sumarsono/dahoam2017/virt/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "captcha_records.py", line 103, in main
    training_data = create_data_list(FLAGS.train_dir)
  File "captcha_records.py", line 92, in create_data_list
    image_gray = image.convert('L')
  File "/home/sumarsono/dahoam2017/virt/lib/python2.7/site-packages/PIL/Image.py", line 857, in convert
    self.load()
  File "/home/sumarsono/dahoam2017/virt/lib/python2.7/site-packages/PIL/ImageFile.py", line 231, in load
    "(%d bytes not processed)" % len(b))
IOError: image file is truncated (0 bytes not processed)

from dahoam2017.

yohanesgultom avatar yohanesgultom commented on July 20, 2024

In case you haven't found out the solution for error below:

Looking for images in './data/train_data'
>> Writing ./data/train.tfrecords
Traceback (most recent call last):
  File "captcha_records.py", line 123, in <module>
    tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
  File "/Users/gintas/Downloads/dahoam2017-master/dahoam/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "captcha_records.py", line 102, in main
    conver_to_tfrecords(training_data, TRAIN_FILE)
  File "captcha_records.py", line 62, in conver_to_tfrecords
    label_raw = label_to_one_hot(label).tostring()
  File "captcha_records.py", line 42, in label_to_one_hot
    index.append(CHAR_SETS.index(c))
ValueError: substring not found

It simply because this line of code below (function create_data_list in captcha_records.py) try to use split the captcha file name using _ as separator:

label_name = os.path.basename(file_name).split('_')[0]

Simply change it to . solve the issue:

label_name = os.path.basename(file_name).split('.')[0]

As for the IOError, apparently your captcha images are not correctly generated as I don't faced such an error.

from dahoam2017.

nalakawula avatar nalakawula commented on July 20, 2024

ok, i'll try tonight
.
thank you

from dahoam2017.

Related Issues (4)

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.