ERROR: IOError: encoder jpeg not available

388 views
Skip to first unread message

Patrick Carson

unread,
Sep 10, 2015, 11:08:58 AM9/10/15
to DIGITS Users

Hi all,

When i am creating a classification dataset I get the following error when DIGITS tries ot create the DB train:

** (create_db.py:20990): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
2015-09-10 16:02:44 [DEBUG] 217 total lines in file
2015-09-10 16:02:44 [INFO ] 217 valid lines in file
2015-09-10 16:02:44 [DEBUG] Category 0 has 76 images.
2015-09-10 16:02:44 [DEBUG] Category 1 has 141 images.
2015-09-10 16:02:47 [DEBUG] Processed 0/217
2015-09-10 16:02:49 [DEBUG] Processed 0/217
2015-09-10 16:02:51 [DEBUG] Processed 100/217
2015-09-10 16:02:52 [DEBUG] 217 images loaded
2015-09-10 16:02:52 [INFO ] 217 images written to database
2015-09-10 16:02:52 [INFO ] Mean saved at "/home/patrick/digits/digits/jobs/20150910-160241-5f5e/mean.binaryproto"
2015-09-10 16:02:52 [ERROR] IOError: encoder jpeg not available
Traceback (most recent call last):
File "/home/patrick/digits/tools/create_db.py", line 637, in <module>
lmdb_map_size   = args['lmdb_map_size']
File "/home/patrick/digits/tools/create_db.py", line 143, in create_db
mean_files, **kwargs)
File "/home/patrick/digits/tools/create_db.py", line 228, in _create_lmdb
_save_means(image_sum, images_written, mean_files)
File "/home/patrick/digits/tools/create_db.py", line 564, in _save_means
image.save(mean_file)
File "/usr/local/lib/python2.7/dist-packages/PIL/Image.py", line 1693, in save
save_handler(self, fp, filename)
File "/usr/local/lib/python2.7/dist-packages/PIL/JpegImagePlugin.py", line 697, in _save
ImageFile._save(im, fp, [("jpeg", (0, 0)+im.size, 0, rawmode)], bufsize)
File "/usr/local/lib/python2.7/dist-packages/PIL/ImageFile.py", line 491, in _save
e = Image._getencoder(im.mode, e, a, im.encoderconfig)
File "/usr/local/lib/python2.7/dist-packages/PIL/Image.py", line 436, in _getencoder
raise IOError("encoder %s not available" % encoder_name)
IOError: encoder jpeg not available


However it is successful for the validation DB:

** (create_db.py:20991): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
2015-09-10 16:02:44 [DEBUG] 72 total lines in file
2015-09-10 16:02:44 [INFO ] 72 valid lines in file
2015-09-10 16:02:44 [DEBUG] Category 0 has 25 images.
2015-09-10 16:02:44 [DEBUG] Category 1 has 47 images.
2015-09-10 16:02:47 [DEBUG] Processed 0/72
2015-09-10 16:02:47 [DEBUG] 72 images loaded
2015-09-10 16:02:47 [INFO ] 72 images written to database
2015-09-10 16:02:47 [INFO ] Database created after 2 seconds.

Any help would be greatly appreciated.

Cheers,
Patrick

Luke Yeager

unread,
Sep 10, 2015, 2:00:42 PM9/10/15
to DIGITS Users
Wow that's weird. I'm assuming it works if you choose PNG or None for the encoding?

What version of PIL do you have?

$ pip list | grep -i pil
Pillow (2.3.0)

PC

unread,
Sep 10, 2015, 4:29:12 PM9/10/15
to DIGITS Users
Thanks for the reply.

my version of PIL is: Pillow (2.8.2)

The above log was produced with image encoding set to PNG (my images are all .png). I tried setting it to none but the same thing happened:


** (create_db.py:25306): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
2015-09-10 21:22:45 [DEBUG] 217 total lines in file
2015-09-10 21:22:45 [INFO ] 217 valid lines in file
2015-09-10 21:22:45 [DEBUG] Category 0 has 151 images.
2015-09-10 21:22:45 [DEBUG] Category 1 has 66 images.
2015-09-10 21:22:47 [DEBUG] Processed 0/217
2015-09-10 21:22:49 [DEBUG] Processed 0/217
2015-09-10 21:22:50 [DEBUG] Doubling LMDB map size to 20MB ...
2015-09-10 21:22:51 [DEBUG] Processed 100/217
2015-09-10 21:22:53 [DEBUG] Doubling LMDB map size to 40MB ...
2015-09-10 21:22:53 [DEBUG] Doubling LMDB map size to 80MB ...
2015-09-10 21:22:53 [DEBUG] 217 images loaded
2015-09-10 21:22:53 [INFO ] 217 images written to database
2015-09-10 21:22:54 [INFO ] Mean saved at "/home/patrick/skycap/digits/digits/jobs/20150910-212240-6ff4/mean.binaryproto"
2015-09-10 21:22:54 [ERROR] IOError: encoder jpeg not available

Traceback (most recent call last):
File "/home/patrick/skycap/digits/tools/create_db.py", line 637, in <module>
lmdb_map_size   = args['lmdb_map_size']
File "/home/patrick/skycap/digits/tools/create_db.py", line 143, in create_db
mean_files, **kwargs)
File "/home/patrick/skycap/digits/tools/create_db.py", line 228, in _create_lmdb
_save_means(image_sum, images_written, mean_files)
File "/home/patrick/skycap/digits/tools/create_db.py", line 564, in _save_means

Luke Yeager

unread,
Sep 10, 2015, 5:34:15 PM9/10/15
to DIGITS Users
http://stackoverflow.com/a/10109941/2404152

Try this: sudo apt-get install libjpeg-dev
Message has been deleted

PC

unread,
Sep 11, 2015, 6:56:52 AM9/11/15
to DIGITS Users
Hi,

Problem fixed. Creating a few symbolic links and then re-installing PIL worked as per (for 64bit machine):

sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib
sudo ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib
sudo ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib

pip install -I pillow



PC

unread,
Sep 11, 2015, 7:07:51 AM9/11/15
to DIGITS Users
I've successfully created the databases and trained the network. However when testing the net by classifying one image it spits out the following error:

AttributeError

'module' object has no attribute 'register_save_all'


Im testing the net with an image that may be bigger in dimensions than the images the net is trained on, which are 32x32.


Not a lot of information to go on though :S


Patrick

Luke Yeager

unread,
Sep 11, 2015, 12:40:05 PM9/11/15
to DIGITS Users
Can you run DIGITS in debug mode (./digits-devserver --debug) and see if that gives you any more information? This sounds like another PIL-related issue.

What did you do to your system - it's all out of whack! You are on Ubuntu 14.04, right?

PC

unread,
Sep 14, 2015, 6:49:54 AM9/14/15
to DIGITS Users
Im running Ubuntu 14.04 - and yes it does seems so :/

Problem is solved now. Fresh install of PIL did the trick.

Diego Rueda

unread,
Sep 15, 2015, 11:55:51 PM9/15/15
to DIGITS Users
what version of PIL are you using? I got to the same problem.
Reply all
Reply to author
Forward
0 new messages