{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"\nThere are lots of packages that you need for installing TensorFlow official model and TensorFlow text. I have collected all those whl and tar.gz files, so you can install two TensorFlow packages in one shot. I also make a public dataset with all packages, you can download them freely if you need.\n\nI only collected the numerous package you need. For installing offline, I followed instructions from 2 notebooks showing below, many thanks for their generosity.\n\nhttps://www.kaggle.com/raghaw/install-segmentation-model-offline-in-infer-kernel https://www.kaggle.com/feifeizaici/a-simple-method-to-install-packages-offline\n","metadata":{"papermill":{"duration":0.007238,"end_time":"2021-06-11T04:07:32.104171","exception":false,"start_time":"2021-06-11T04:07:32.096933","status":"completed"},"tags":[]}},{"cell_type":"code","source":"!ls ../input/tf-installing-packageofficial-model-and-text","metadata":{"papermill":{"duration":0.767952,"end_time":"2021-06-11T04:07:32.878464","exception":false,"start_time":"2021-06-11T04:07:32.110512","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2021-06-11T04:28:34.970307Z","iopub.execute_input":"2021-06-11T04:28:34.970566Z","iopub.status.idle":"2021-06-11T04:28:35.711366Z","shell.execute_reply.started":"2021-06-11T04:28:34.970539Z","shell.execute_reply":"2021-06-11T04:28:35.710142Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!mkdir -p /tmp/pip/cache/","metadata":{"papermill":{"duration":0.768521,"end_time":"2021-06-11T04:07:33.654215","exception":false,"start_time":"2021-06-11T04:07:32.885694","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2021-06-11T04:28:35.713226Z","iopub.execute_input":"2021-06-11T04:28:35.713522Z","iopub.status.idle":"2021-06-11T04:28:36.451338Z","shell.execute_reply.started":"2021-06-11T04:28:35.713495Z","shell.execute_reply":"2021-06-11T04:28:36.449977Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!cp ../input/tf-installing-packageofficial-model-and-text/cached_property-1.5.2-py2.py3-none-any.whl /tmp/pip/cache/\n!cp ../input/tf-installing-packageofficial-model-and-text/gast-0.4.0-py3-none-any.whl /tmp/pip/cache/\n!cp ../input/tf-installing-packageofficial-model-and-text/gin_config-0.4.0-py2.py3-none-any.whl /tmp/pip/cache/\n!cp ../input/tf-installing-packageofficial-model-and-text/grpcio-1.34.1-cp37-cp37m-manylinux2014_x86_64.whl /tmp/pip/cache/\n!cp ../input/tf-installing-packageofficial-model-and-text/h5py-3.1.0-cp37-cp37m-manylinux1_x86_64.whl /tmp/pip/cache/\n!cp ../input/tf-installing-packageofficial-model-and-text/keras_nightly-2.5.0.dev2021032900-py2.py3-none-any.whl /tmp/pip/cache/\n!cp ../input/tf-installing-packageofficial-model-and-text/portalocker-2.0.0-py2.py3-none-any.whl /tmp/pip/cache/\n!cp ../input/tf-installing-packageofficial-model-and-text/py-cpuinfo-8.0.0.xyz.csv /tmp/pip/cache/py-cpuinfo-8.0.0.tar.gz\n!cp ../input/tf-installing-packageofficial-model-and-text/pycocotools-2.0.2.xyz.csv /tmp/pip/cache/pycocotools-2.0.2.tar.gz\n!cp ../input/tf-installing-packageofficial-model-and-text/sacrebleu-1.5.1-py3-none-any.whl /tmp/pip/cache/\n!cp ../input/tf-installing-packageofficial-model-and-text/seqeval-1.2.2-py3-none-any.whl /tmp/pip/cache/\n!cp ../input/tf-installing-packageofficial-model-and-text/tensorboard-2.5.0-py3-none-any.whl /tmp/pip/cache/\n!cp ../input/tf-installing-packageofficial-model-and-text/tensorboard_data_server-0.6.1-py3-none-manylinux2010_x86_64.whl /tmp/pip/cache/\n!cp ../input/tf-installing-packageofficial-model-and-text/tensorflow-2.5.0-cp37-cp37m-manylinux2010_x86_64.whl /tmp/pip/cache/\n!cp ../input/tf-installing-packageofficial-model-and-text/tensorflow_estimator-2.5.0-py2.py3-none-any.whl /tmp/pip/cache/\n!cp ../input/tf-installing-packageofficial-model-and-text/tensorflow_model_optimization-0.5.0-py2.py3-none-any.whl /tmp/pip/cache/\n!cp ../input/tf-installing-packageofficial-model-and-text/tensorflow_text-2.5.0-cp37-cp37m-manylinux1_x86_64.whl /tmp/pip/cache/\n!cp ../input/tf-installing-packageofficial-model-and-text/tf_models_official-2.5.0-py2.py3-none-any.whl /tmp/pip/cache/\n!cp ../input/tf-installing-packageofficial-model-and-text/tf_slim-1.1.0-py2.py3-none-any.whl /tmp/pip/cache/","metadata":{"papermill":{"duration":20.742215,"end_time":"2021-06-11T04:07:54.406569","exception":false,"start_time":"2021-06-11T04:07:33.664354","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2021-06-11T04:28:36.455036Z","iopub.execute_input":"2021-06-11T04:28:36.455344Z","iopub.status.idle":"2021-06-11T04:28:51.736909Z","shell.execute_reply.started":"2021-06-11T04:28:36.455308Z","shell.execute_reply":"2021-06-11T04:28:51.735628Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!mkdir -p /tmp/pip/cache/\n!pip install --no-index --find-links /tmp/pip/cache/ tensorflow-text\n!pip install --no-index --find-links /tmp/pip/cache/ tf-models-official","metadata":{"papermill":{"duration":76.60136,"end_time":"2021-06-11T04:09:11.015296","exception":false,"start_time":"2021-06-11T04:07:54.413936","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2021-06-11T04:28:51.738834Z","iopub.execute_input":"2021-06-11T04:28:51.739139Z","iopub.status.idle":"2021-06-11T04:29:03.457713Z","shell.execute_reply.started":"2021-06-11T04:28:51.739111Z","shell.execute_reply":"2021-06-11T04:29:03.456838Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import tensorflow_text as text\nfrom official.nlp import optimization","metadata":{"papermill":{"duration":3.239094,"end_time":"2021-06-11T04:09:14.284041","exception":false,"start_time":"2021-06-11T04:09:11.044947","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2021-06-11T04:29:03.459033Z","iopub.execute_input":"2021-06-11T04:29:03.459303Z","iopub.status.idle":"2021-06-11T04:29:03.464114Z","shell.execute_reply.started":"2021-06-11T04:29:03.459276Z","shell.execute_reply":"2021-06-11T04:29:03.463215Z"},"trusted":true},"execution_count":null,"outputs":[]}]}