Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mona@pascal:~/computer_vision/image_retrieval$ python download_images.py
- /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.
- InsecurePlatformWarning
- [LOG] Getting url: http://i.imgur.com/aDKYF.jpg
- Traceback (most recent call last):
- File "download_images.py", line 51, in <module>
- 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:
- IOError: [Errno 2] No such file or directory: u'/home/mona/computer_vision/image_retrieval/images/car/16-10-11-1476218862F.jpg'
- Code is:
- try:
- image_file = urllib2.urlopen(submission.url, timeout = 5)
- 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:
- output_image.write(image_file.read())
- except urllib2.URLError as e:
- print(e)
- continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement