Advertisement
lamiastella

Untitled

Oct 11th, 2016
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. mona@pascal:~/computer_vision/image_retrieval$ python download_images.py
  2. /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  3. InsecurePlatformWarning
  4. [LOG] Getting url: http://i.imgur.com/aDKYF.jpg
  5. Traceback (most recent call last):
  6. File "download_images.py", line 51, in <module>
  7. with open('/home/mona/computer_vision/image_retrieval/images/'+ category+ '/'+ datetime.datetime.now().strftime('%y-%m-%d-%s') + submission.url[-5:], 'wb') as output_image:
  8. IOError: [Errno 2] No such file or directory: u'/home/mona/computer_vision/image_retrieval/images/car/16-10-11-1476218862F.jpg'
  9.  
  10.  
  11.  
  12. Code is:
  13. try:
  14. image_file = urllib2.urlopen(submission.url, timeout = 5)
  15. with open('/home/mona/computer_vision/image_retrieval/images/'+ category+ '/'+ datetime.datetime.now().strftime('%y-%m-%d-%s') + submission.url[-5:], 'wb') as output_image:
  16. output_image.write(image_file.read())
  17. except urllib2.URLError as e:
  18. print(e)
  19. continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement