Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Drawing Classifier #1808

Closed
TobyRoseman opened this issue Apr 29, 2019 · 0 comments · Fixed by #1813
Closed

Drawing Classifier #1808

TobyRoseman opened this issue Apr 29, 2019 · 0 comments · Fixed by #1813

Comments

@TobyRoseman
Copy link
Collaborator

Calling tc.drawing_classifier.create(...) with warm_start=quickdraw_245_v0 produces an exception. Another exception is generated while dealing with the first exception. The docstrings indicated that warm_start=quickdraw_245_v0 is a valid argument.

In [12]: model = tc.drawing_classifier.create(train_set, 
    ...:                                      target='label', 
    ...:                                      feature='data', 
    ...:                                      warm_start = 'quickdraw_245_v0')                                                                                                  
PROGRESS: Creating a validation set from 5 percent of training data. This may take a while.
          You can set ``validation_set=None`` to disable validation tracking.

+------------------------+------------------------+------------------------+------------------------+------------------------+
| Iteration              | Training Loss          | Training Accuracy      | Validation Accuracy    | Elapsed Time (seconds) |
+------------------------+------------------------+------------------------+------------------------+------------------------+
ERROR: Download failed: Invalid URL 'quickdraw_245_v0': No schema supplied. Perhaps you meant http://quickdraw_245_v0?
An exception has occurred, use %tb to see the full traceback.

SystemExit: 1

/Users/tobyroseman/anaconda3/envs/benchmarks-dev/lib/python3.6/site-packages/IPython/core/interactiveshell.py:3304: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.
  warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)

In [13]: %tb                                                                                                                                                                    
---------------------------------------------------------------------------
MissingSchema                             Traceback (most recent call last)
~/anaconda3/envs/benchmarks-dev/lib/python3.6/site-packages/turicreate/toolkits/_pre_trained_models.py in _download_and_checksum_files(urls, dirname, delete)
     58             if not _os.path.exists(fn):
---> 59                 r = _requests.get(url, stream=True)
     60                 assert r.status_code == 200, "%s (%d)" % (r.reason, r.status_code)

~/anaconda3/envs/benchmarks-dev/lib/python3.6/site-packages/requests/api.py in get(url, params, **kwargs)
     71     kwargs.setdefault('allow_redirects', True)
---> 72     return request('get', url, params=params, **kwargs)
     73 

~/anaconda3/envs/benchmarks-dev/lib/python3.6/site-packages/requests/api.py in request(method, url, **kwargs)
     57     with sessions.Session() as session:
---> 58         return session.request(method=method, url=url, **kwargs)
     59 

~/anaconda3/envs/benchmarks-dev/lib/python3.6/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    493         )
--> 494         prep = self.prepare_request(req)
    495 

~/anaconda3/envs/benchmarks-dev/lib/python3.6/site-packages/requests/sessions.py in prepare_request(self, request)
    436             cookies=merged_cookies,
--> 437             hooks=merge_hooks(request.hooks, self.hooks),
    438         )

~/anaconda3/envs/benchmarks-dev/lib/python3.6/site-packages/requests/models.py in prepare(self, method, url, headers, files, data, params, auth, cookies, hooks, json)
    304         self.prepare_method(method)
--> 305         self.prepare_url(url, params)
    306         self.prepare_headers(headers)

~/anaconda3/envs/benchmarks-dev/lib/python3.6/site-packages/requests/models.py in prepare_url(self, url, params)
    378 
--> 379             raise MissingSchema(error)
    380 

MissingSchema: Invalid URL 'quickdraw_245_v0': No schema supplied. Perhaps you meant http://quickdraw_245_v0?

During handling of the above exception, another exception occurred:

SystemExit                                Traceback (most recent call last)
<ipython-input-12-45d8b3d5e4eb> in <module>
      3                                      feature='data',
      4                                      # XXX: batch_size
----> 5                                      warm_start = 'quickdraw_245_v0')

~/anaconda3/envs/benchmarks-dev/lib/python3.6/site-packages/turicreate/toolkits/drawing_classifier/drawing_classifier.py in create(input_dataset, target, feature, validation_set, warm_start, batch_size, max_iterations, verbose)
    221         pretrained_model = _pre_trained_models.DrawingClassifierPreTrainedModel(
    222             warm_start)
--> 223         pretrained_model_params_path = pretrained_model.get_model_path()
    224         model.load_params(pretrained_model_params_path, 
    225             ctx=ctx,

~/anaconda3/envs/benchmarks-dev/lib/python3.6/site-packages/turicreate/toolkits/_pre_trained_models.py in get_model_path(self)
    260     def get_model_path(self):
    261         model_path = _download_and_checksum_files(
--> 262             [(self.source_url, self.source_md5)], _get_model_cache_dir()
    263             )[0]
    264         return model_path

~/anaconda3/envs/benchmarks-dev/lib/python3.6/site-packages/turicreate/toolkits/_pre_trained_models.py in _download_and_checksum_files(urls, dirname, delete)
     77             if _os.path.exists(fn):
     78                 _os.remove(fn)
---> 79         _sys.exit(1)
     80     return fns
     81 

SystemExit: 1

If you instead pass a garbage values for warm_start you get similar behavior.

Expected:

  • If the docstrings says warm_start=quickdraw_245_v0 should work, then it should work.
  • If the user passes in a garbage value, they should get a more straightforward error message.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
5.5 - Convergence
  
Awaiting triage
Development

Successfully merging a pull request may close this issue.

2 participants