This is the source code for the Text Classification with TensorFlow Lite and Firebase on Android codelab.
firebaseextended / codelab-textclassification-android Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
This is the source code for the Text Classification with TensorFlow Lite and Firebase on Android codelab.
Hi.
Please update the section 11 of Add on-device Text Classification to your app with TensorFlow Lite and Firebase - Android Codelab tutorial replacing the dependency org.tensorflow:tensorflow-lite-task-text:0.0.0-nightly
by org.tensorflow:tensorflow-lite-task-text:0.1.0
.
With this it is also necessary to update de minSdkVersion
to 21.
Regards.
I want to operate the colab for receive a .tflite file. But I have a trouble when running this cell:
data_dir = tf.keras.utils.get_file( fname='SST-2.zip', origin='https://firebasestorage.googleapis.com/v0/b/mtl-sentence-representations.appspot.com/o/data%2FSST-2.zip?alt=media&token=aabc5f6b-e466-44a2-b9b4-cf6337f84ac8', extract=True) data_dir = os.path.join(os.path.dirname(data_dir), 'SST-2')
which thows Traceback:
`---------------------------------------------------------------------------
HTTPError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/utils/data_utils.py in get_file(fname, origin, untar, md5_hash, file_hash, cache_subdir, hash_algorithm, extract, archive_format, cache_dir)
274 try:
--> 275 urlretrieve(origin, fpath, dl_progress)
276 except HTTPError as e:
8 frames
/usr/lib/python3.6/urllib/request.py in urlretrieve(url, filename, reporthook, data)
247
--> 248 with contextlib.closing(urlopen(url, data)) as fp:
249 headers = fp.info()
/usr/lib/python3.6/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
222 opener = _opener
--> 223 return opener.open(url, data, timeout)
224
/usr/lib/python3.6/urllib/request.py in open(self, fullurl, data, timeout)
531 meth = getattr(processor, meth_name)
--> 532 response = meth(req, response)
533
/usr/lib/python3.6/urllib/request.py in http_response(self, request, response)
641 response = self.parent.error(
--> 642 'http', request, response, code, msg, hdrs)
643
/usr/lib/python3.6/urllib/request.py in error(self, proto, *args)
569 args = (dict, 'default', 'http_error_default') + orig_args
--> 570 return self._call_chain(*args)
571
/usr/lib/python3.6/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)
503 func = getattr(handler, meth_name)
--> 504 result = func(*args)
505 if result is not None:
/usr/lib/python3.6/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)
649 def http_error_default(self, req, fp, code, msg, hdrs):
--> 650 raise HTTPError(req.full_url, code, msg, hdrs, fp)
651
HTTPError: HTTP Error 403: Forbidden
During handling of the above exception, another exception occurred:
Exception Traceback (most recent call last)
in ()
2 fname='SST-2.zip',
3 origin='https://firebasestorage.googleapis.com/v0/b/mtl-sentence-representations.appspot.com/o/data%2FSST-2.zip?alt=media&token=aabc5f6b-e466-44a2-b9b4-cf6337f84ac8',
----> 4 extract=True)
5 data_dir = os.path.join(os.path.dirname(data_dir), 'SST-2')
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/utils/data_utils.py in get_file(fname, origin, untar, md5_hash, file_hash, cache_subdir, hash_algorithm, extract, archive_format, cache_dir)
275 urlretrieve(origin, fpath, dl_progress)
276 except HTTPError as e:
--> 277 raise Exception(error_msg.format(origin, e.code, e.msg))
278 except URLError as e:
279 raise Exception(error_msg.format(origin, e.errno, e.reason))
Exception: URL fetch failure on https://firebasestorage.googleapis.com/v0/b/mtl-sentence-representations.appspot.com/o/data%2FSST-2.zip?alt=media&token=aabc5f6b-e466-44a2-b9b4-cf6337f84ac8: 403 -- Forbidden
---------------------------------------------------------------------------`
Is that URL already outdated?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.