| 1 | 1 |
"cells": [
|
| 2 | 2 |
{
|
| 3 | 3 |
"cell_type": "code",
|
| 4 | |
"execution_count": null,
|
| 5 | |
"id": "f6a173d7",
|
|
4 |
"execution_count": 2,
|
|
5 |
"id": "55ec6f8f",
|
| 6 | 6 |
"metadata": {},
|
| 7 | 7 |
"outputs": [
|
| 8 | 8 |
{
|
|
| 12 | 12 |
"Looking in indexes: https://pypi.doubanio.com/simple/\n",
|
| 13 | 13 |
"Collecting timm==0.4.12\n",
|
| 14 | 14 |
" Downloading https://pypi.doubanio.com/packages/90/fc/606bc5cf46acac3aa9bd179b3954433c026aaf88ea98d6b19f5d14c336da/timm-0.4.12-py3-none-any.whl (376 kB)\n",
|
| 15 | |
"\u001b[K |████████████████████████████████| 376 kB 2.6 MB/s eta 0:00:01\n",
|
| 16 | |
"\u001b[?25hCollecting transformers==4.15.0\n",
|
| 17 | |
" Downloading https://pypi.doubanio.com/packages/4a/7f/f1c28621af0d74794b18cbe5534ec7565ee782ba48257d08ec264bc4aacb/transformers-4.15.0-py3-none-any.whl (3.4 MB)\n",
|
| 18 | |
"\u001b[K |████████████████████████████████| 3.4 MB 1.2 MB/s eta 0:00:01\n",
|
| 19 | |
"\u001b[?25hCollecting fairscale==0.4.4\n",
|
| 20 | |
" Downloading https://pypi.doubanio.com/packages/9f/51/9b8406605333f7d0a2e6f6a4af29ff64cf6c597b056411c1ed43c35e32b8/fairscale-0.4.4.tar.gz (235 kB)\n",
|
| 21 | |
"\u001b[K |████████████████████████████████| 235 kB 516 kB/s eta 0:00:01\n",
|
| 22 | |
"\u001b[?25h Installing build dependencies ... \u001b[?25ldone\n",
|
| 23 | |
"\u001b[?25h Getting requirements to build wheel ... \u001b[?25ldone\n",
|
| 24 | |
"\u001b[?25h Installing backend dependencies ... \u001b[?25ldone\n",
|
| 25 | |
"\u001b[?25h Preparing wheel metadata ... \u001b[?25ldone\n",
|
| 26 | |
"\u001b[33mWARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError(\"HTTPSConnectionPool(host='pypi.doubanio.com', port=443): Read timed out. (read timeout=15)\")': /simple/pycocoevalcap/\u001b[0m\n",
|
| 27 | |
"\u001b[?25hCollecting pycocoevalcap\n",
|
| 28 | |
" Downloading https://pypi.doubanio.com/packages/08/f9/466f289f1628296b5e368940f89e3cfcfb066d15ddc02ff536dc532b1c93/pycocoevalcap-1.2-py3-none-any.whl (104.3 MB)\n",
|
| 29 | |
"\u001b[K |████████████████████████████████| 104.3 MB 76 kB/s s eta 0:00:01 MB/s eta 0:00:20��████▍ | 34.0 MB 7.7 MB/s eta 0:00:10███ | 42.7 MB 7.7 MB/s eta 0:00:09�██████████▍ | 50.2 MB 7.7 MB/s eta 0:00:08�███████████ | 52.3 MB 7.7 MB/s eta 0:00:07/s eta 0:00:07��█▎ | 56.3 MB 7.7 MB/s eta 0:00:07[K |██████████████████▌ | 60.3 MB 70.0 MB/s eta 0:00:01 | 62.6 MB 70.0 MB/s eta 0:00:01�████████▌ | 66.8 MB 70.0 MB/s eta 0:00:01��████████████████▋ | 80.3 MB 70.0 MB/s eta 0:00:01 | 87.7 MB 70.0 MB/s eta 0:00:01��████████▊ | 90.3 MB 70.0 MB/s eta 0:00:01��███████████████████▉ | 94.0 MB 70.0 MB/s eta 0:00:01�█▊ | 100.2 MB 38.2 MB/s eta 0:00:01\n",
|
| 30 | |
"\u001b[?25hRequirement already satisfied: torchvision in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from timm==0.4.12->-r requirement.txt (line 1)) (0.5.0+cpu)\n",
|
| 31 | |
"Requirement already satisfied: torch>=1.4 in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from timm==0.4.12->-r requirement.txt (line 1)) (1.4.0+cpu)\n",
|
|
15 |
"\u001b[K |████████████████████████████████| 376 kB 3.6 MB/s eta 0:00:01\n",
|
|
16 |
"\u001b[?25hRequirement already satisfied: transformers==4.15.0 in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from -r requirement.txt (line 2)) (4.15.0)\n",
|
|
17 |
"Requirement already satisfied: fairscale==0.4.4 in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from -r requirement.txt (line 3)) (0.4.4)\n",
|
|
18 |
"Requirement already satisfied: pycocoevalcap in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from -r requirement.txt (line 4)) (1.2)\n",
|
|
19 |
"Requirement already satisfied: torchvision in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from timm==0.4.12->-r requirement.txt (line 1)) (0.12.0)\n",
|
|
20 |
"Requirement already satisfied: torch>=1.4 in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from timm==0.4.12->-r requirement.txt (line 1)) (1.11.0)\n",
|
|
21 |
"Requirement already satisfied: tokenizers<0.11,>=0.10.1 in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from transformers==4.15.0->-r requirement.txt (line 2)) (0.10.3)\n",
|
|
22 |
"Requirement already satisfied: requests in /usr/local/lib/python3.7/dist-packages (from transformers==4.15.0->-r requirement.txt (line 2)) (2.27.1)\n",
|
|
23 |
"Requirement already satisfied: tqdm>=4.27 in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from transformers==4.15.0->-r requirement.txt (line 2)) (4.46.1)\n",
|
|
24 |
"Requirement already satisfied: regex!=2019.12.17 in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from transformers==4.15.0->-r requirement.txt (line 2)) (2022.1.18)\n",
|
|
25 |
"Requirement already satisfied: huggingface-hub<1.0,>=0.1.0 in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from transformers==4.15.0->-r requirement.txt (line 2)) (0.8.1)\n",
|
|
26 |
"Requirement already satisfied: packaging>=20.0 in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from transformers==4.15.0->-r requirement.txt (line 2)) (21.3)\n",
|
|
27 |
"Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.7/dist-packages (from transformers==4.15.0->-r requirement.txt (line 2)) (1.18.5)\n",
|
|
28 |
"Requirement already satisfied: importlib-metadata in /usr/local/lib/python3.7/dist-packages (from transformers==4.15.0->-r requirement.txt (line 2)) (4.11.1)\n",
|
| 32 | 29 |
"Requirement already satisfied: pyyaml>=5.1 in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from transformers==4.15.0->-r requirement.txt (line 2)) (6.0)\n",
|
| 33 | |
"Requirement already satisfied: tqdm>=4.27 in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from transformers==4.15.0->-r requirement.txt (line 2)) (4.46.1)\n",
|
| 34 | |
"\u001b[33mWARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError(\"HTTPSConnectionPool(host='pypi.doubanio.com', port=443): Read timed out. (read timeout=15)\")': /simple/tokenizers/\u001b[0m\n",
|
| 35 | |
"Collecting tokenizers<0.11,>=0.10.1\n",
|
| 36 | |
" Downloading https://pypi.doubanio.com/packages/d4/e2/df3543e8ffdab68f5acc73f613de9c2b155ac47f162e725dcac87c521c11/tokenizers-0.10.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (3.3 MB)\n",
|
| 37 | |
"\u001b[K |████████████████████████████████| 3.3 MB 4.1 MB/s eta 0:00:01\n",
|
| 38 | |
"\u001b[?25hRequirement already satisfied: sacremoses in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from transformers==4.15.0->-r requirement.txt (line 2)) (0.0.47)\n",
|
| 39 | |
"Requirement already satisfied: regex!=2019.12.17 in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from transformers==4.15.0->-r requirement.txt (line 2)) (2022.1.18)\n",
|
| 40 | |
"Requirement already satisfied: importlib-metadata in /usr/local/lib/python3.7/dist-packages (from transformers==4.15.0->-r requirement.txt (line 2)) (4.11.1)\n",
|
| 41 | |
"Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.7/dist-packages (from transformers==4.15.0->-r requirement.txt (line 2)) (1.18.5)\n",
|
| 42 | |
"Collecting huggingface-hub<1.0,>=0.1.0\n",
|
| 43 | |
" Downloading https://pypi.doubanio.com/packages/d8/2c/9af8451ab780598e3b26a84d4f0e3844841456657401eb6843fdb622bb41/huggingface_hub-0.8.1-py3-none-any.whl (101 kB)\n",
|
| 44 | |
"\u001b[K |████████████████████████████████| 101 kB 1.7 MB/s ta 0:00:01\n",
|
| 45 | |
"\u001b[?25hRequirement already satisfied: packaging>=20.0 in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from transformers==4.15.0->-r requirement.txt (line 2)) (21.3)\n",
|
|
30 |
"Requirement already satisfied: sacremoses in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from transformers==4.15.0->-r requirement.txt (line 2)) (0.0.47)\n",
|
| 46 | 31 |
"Requirement already satisfied: filelock in /usr/local/lib/python3.7/dist-packages (from transformers==4.15.0->-r requirement.txt (line 2)) (3.6.0)\n",
|
| 47 | |
"Requirement already satisfied: requests in /usr/local/lib/python3.7/dist-packages (from transformers==4.15.0->-r requirement.txt (line 2)) (2.27.1)\n",
|
| 48 | |
"Collecting torch>=1.4\n",
|
| 49 | |
" Downloading https://pypi.doubanio.com/packages/94/32/96a0955e5d6ed8a837eda5ca095dd2694c4617cfa70ca599660cd5ff7447/torch-1.11.0-cp37-cp37m-manylinux1_x86_64.whl (750.6 MB)\n",
|
| 50 | |
"\u001b[K |████████████████████████████████| 750.6 MB 7.6 kB/s eta 0:00:013 | 9.7 MB 2.2 MB/s eta 0:05:32 | 31.8 MB 5.0 MB/s eta 0:02:2335 | 92.4 MB 47.4 MB/s eta 0:00:14 |████▏ | 97.0 MB 47.4 MB/s eta 0:00:14MB/s eta 0:00:14MB/s eta 0:00:14| 106.7 MB 47.4 MB/s eta 0:00:14MB/s eta 0:00:15█▊ | 135.3 MB 43.3 MB/s eta 0:00:15MB 43.3 MB/s eta 0:00:141210 | 221.0 MB 7.8 MB/s eta 0:01:08 |██████████▎ | 241.8 MB 8.4 MB/s eta 0:01:01 |██████████▌ | 245.7 MB 8.4 MB/s eta 0:01:01 |██████████▊ | 252.0 MB 8.4 MB/s eta 0:01:00 |██████████▉ | 254.2 MB 8.4 MB/s eta 0:01:00 |███████████ | 260.6 MB 8.4 MB/s eta 0:00:59��███████ | 282.8 MB 6.7 MB/s eta 0:01:11��████████▎ | 288.8 MB 6.7 MB/s eta 0:01:10��████████▊ | 298.7 MB 6.7 MB/s eta 0:01:08 | 311.1 MB 65.1 MB/s eta 0:00:07�█████████▊ | 346.0 MB 65.1 MB/s eta 0:00:07�██████████ | 350.0 MB 65.1 MB/s eta 0:00:07 |███████████████ | 352.1 MB 131.8 MB/s eta 0:00:04| 356.1 MB 131.8 MB/s eta 0:00:03| 358.3 MB 131.8 MB/s eta 0:00:03| 362.6 MB 131.8 MB/s eta 0:00:03 |████████████████ | 375.8 MB 131.8 MB/s eta 0:00:03��██████▎ | 381.7 MB 131.8 MB/s eta 0:00:03 | 388.1 MB 4.7 MB/s eta 0:01:17 | 394.5 MB 4.7 MB/s eta 0:01:16 | 400.9 MB 4.7 MB/s eta 0:01:14 |█████████████████▏ | 403.5 MB 4.7 MB/s eta 0:01:14��███████▋ | 413.7 MB 4.7 MB/s eta 0:01:11��███████▊ | 416.6 MB 4.7 MB/s eta 0:01:11 | 420.2 MB 4.7 MB/s eta 0:01:10[K |██████████████████▏ | 426.3 MB 5.4 MB/s eta 0:01:00[K |██████████████████▌ | 434.5 MB 5.4 MB/s eta 0:00:59[K |██████████████████▊ | 439.6 MB 5.4 MB/s eta 0:00:58 |██████████████████▉ | 442.1 MB 5.4 MB/s eta 0:00:57[K |███████████████████ | 446.0 MB 5.4 MB/s eta 0:00:57 |███████████████████ | 448.2 MB 5.4 MB/s eta 0:00:56 | 452.2 MB 5.4 MB/s eta 0:00:56 | 453.5 MB 5.4 MB/s eta 0:00:55 | 458.1 MB 5.4 MB/s eta 0:00:55 | 464.4 MB 7.2 MB/s eta 0:00:40 | 465.5 MB 7.2 MB/s eta 0:00:40�████████▍ | 477.5 MB 7.2 MB/s eta 0:00:39��████████████████▌ | 481.9 MB 7.2 MB/s eta 0:00:38�████████▉ | 487.9 MB 7.2 MB/s eta 0:00:37�█████████ | 491.9 MB 7.2 MB/s eta 0:00:37�█████████ | 494.0 MB 7.2 MB/s eta 0:00:36:00:14:00:13:00:13 | 531.0 MB 18.8 MB/s eta 0:00:12 | 535.1 MB 18.8 MB/s eta 0:00:12 | 537.3 MB 18.8 MB/s eta 0:00:12�███████████ | 562.0 MB 39.7 MB/s eta 0:00:05██████████████████████▉ | 582.4 MB 41.0 MB/s eta 0:00:05███████████████████████ | 588.7 MB 41.0 MB/s eta 0:00:04MB/s eta 0:00:04��████████████████████████▌ | 668.7 MB 51.3 MB/s eta 0:00:02��█████████████████████████ | 681.2 MB 51.3 MB/s eta 0:00:02ta 0:00:02 |█████████████████████████████▊ | 698.2 MB 3.3 MB/s eta 0:00:16 |██████████████████████████████ | 704.6 MB 3.3 MB/s eta 0:00:148 MB 3.3 MB/s eta 0:00:130 MB 3.3 MB/s eta 0:00:11��███████████▍| 735.3 MB 40.7 MB/s eta 0:00:01\n",
|
| 51 | |
"\u001b[?25hRequirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.7/dist-packages (from huggingface-hub<1.0,>=0.1.0->transformers==4.15.0->-r requirement.txt (line 2)) (4.1.1)\n",
|
|
32 |
"Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.7/dist-packages (from huggingface-hub<1.0,>=0.1.0->transformers==4.15.0->-r requirement.txt (line 2)) (4.1.1)\n",
|
| 52 | 33 |
"Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from packaging>=20.0->transformers==4.15.0->-r requirement.txt (line 2)) (3.0.7)\n",
|
| 53 | |
"Collecting pycocotools>=2.0.2\n",
|
| 54 | |
" Downloading https://pypi.doubanio.com/packages/75/5c/ac61ea715d7a89ecc31c090753bde28810238225ca8b71778dfe3e6a68bc/pycocotools-2.0.4.tar.gz (106 kB)\n",
|
| 55 | |
"\u001b[K |████████████████████████████████| 106 kB 1.6 MB/s eta 0:00:01\n",
|
| 56 | |
"\u001b[?25h Installing build dependencies ... \u001b[?25ldone\n",
|
| 57 | |
"\u001b[?25h Getting requirements to build wheel ... \u001b[?25ldone\n",
|
| 58 | |
"\u001b[?25h Preparing wheel metadata ... \u001b[?25ldone\n",
|
| 59 | |
"\u001b[?25hRequirement already satisfied: matplotlib>=2.1.0 in /usr/local/lib/python3.7/dist-packages (from pycocotools>=2.0.2->pycocoevalcap->-r requirement.txt (line 4)) (3.0.3)\n",
|
|
34 |
"Requirement already satisfied: pycocotools>=2.0.2 in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from pycocoevalcap->-r requirement.txt (line 4)) (2.0.4)\n",
|
|
35 |
"Requirement already satisfied: matplotlib>=2.1.0 in /usr/local/lib/python3.7/dist-packages (from pycocotools>=2.0.2->pycocoevalcap->-r requirement.txt (line 4)) (3.0.3)\n",
|
|
36 |
"Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib>=2.1.0->pycocotools>=2.0.2->pycocoevalcap->-r requirement.txt (line 4)) (2.8.2)\n",
|
| 60 | 37 |
"Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib>=2.1.0->pycocotools>=2.0.2->pycocoevalcap->-r requirement.txt (line 4)) (1.3.2)\n",
|
| 61 | 38 |
"Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib>=2.1.0->pycocotools>=2.0.2->pycocoevalcap->-r requirement.txt (line 4)) (0.11.0)\n",
|
| 62 | |
"Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib>=2.1.0->pycocotools>=2.0.2->pycocoevalcap->-r requirement.txt (line 4)) (2.8.2)\n",
|
| 63 | 39 |
"Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.7/dist-packages (from python-dateutil>=2.1->matplotlib>=2.1.0->pycocotools>=2.0.2->pycocoevalcap->-r requirement.txt (line 4)) (1.16.0)\n",
|
| 64 | 40 |
"Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata->transformers==4.15.0->-r requirement.txt (line 2)) (3.7.0)\n",
|
| 65 | 41 |
"Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.7/dist-packages (from requests->transformers==4.15.0->-r requirement.txt (line 2)) (2.0.12)\n",
|
|
42 |
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests->transformers==4.15.0->-r requirement.txt (line 2)) (2021.10.8)\n",
|
|
43 |
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->transformers==4.15.0->-r requirement.txt (line 2)) (3.3)\n",
|
| 66 | 44 |
"Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests->transformers==4.15.0->-r requirement.txt (line 2)) (1.26.8)\n",
|
| 67 | |
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->transformers==4.15.0->-r requirement.txt (line 2)) (3.3)\n",
|
| 68 | |
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests->transformers==4.15.0->-r requirement.txt (line 2)) (2021.10.8)\n",
|
|
45 |
"Requirement already satisfied: click in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from sacremoses->transformers==4.15.0->-r requirement.txt (line 2)) (8.0.4)\n",
|
| 69 | 46 |
"Requirement already satisfied: joblib in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from sacremoses->transformers==4.15.0->-r requirement.txt (line 2)) (1.1.0)\n",
|
| 70 | |
"Requirement already satisfied: click in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from sacremoses->transformers==4.15.0->-r requirement.txt (line 2)) (8.0.4)\n",
|
| 71 | |
"Collecting torchvision\n",
|
| 72 | |
" Downloading https://pypi.doubanio.com/packages/11/5a/6dc5d28e352187502f80b4015fb05ccdd401fa6125f51750a789f2536c18/torchvision-0.12.0-cp37-cp37m-manylinux1_x86_64.whl (21.0 MB)\n",
|
| 73 | |
"\u001b[K |████████████████████████████████| 21.0 MB 18 kB/s eta 0:00:01 |█████████████▎ | 8.7 MB 1.5 MB/s eta 0:00:09/s eta 0:00:07:00:04\n",
|
| 74 | |
"\u001b[?25hRequirement already satisfied: pillow!=8.3.*,>=5.3.0 in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from torchvision->timm==0.4.12->-r requirement.txt (line 1)) (8.1.0)\n",
|
| 75 | |
"Building wheels for collected packages: fairscale, pycocotools\n",
|
| 76 | |
" Building wheel for fairscale (PEP 517) ... \u001b[?25ldone\n",
|
| 77 | |
"\u001b[?25h Created wheel for fairscale: filename=fairscale-0.4.4-py3-none-any.whl size=292864 sha256=d5184bc0ef09024f2d7f9e0ead707074b4dcc94de47d0c2f36254f95a2ced5db\n",
|
| 78 | |
" Stored in directory: /home/jovyan/.cache/pip/wheels/88/27/5a/046dd50d60ab3aac5b16392e29c216a160268e09e03ec3a598\n",
|
| 79 | |
" Building wheel for pycocotools (PEP 517) ... \u001b[?25ldone\n",
|
| 80 | |
"\u001b[?25h Created wheel for pycocotools: filename=pycocotools-2.0.4-cp37-cp37m-linux_x86_64.whl size=265221 sha256=b0baa11d99ae1369caba52b9fc679e3e7d80c670bdcdf1bd32b9614945b49f3f\n",
|
| 81 | |
" Stored in directory: /home/jovyan/.cache/pip/wheels/84/a2/01/c56ec9c809432ac11fb4ff58c9b80e1182f2a649828984ad87\n",
|
| 82 | |
"Successfully built fairscale pycocotools\n",
|
| 83 | |
"Installing collected packages: torch, torchvision, tokenizers, pycocotools, huggingface-hub, transformers, timm, pycocoevalcap, fairscale\n",
|
| 84 | |
" Attempting uninstall: torch\n",
|
| 85 | |
" Found existing installation: torch 1.4.0+cpu\n",
|
| 86 | |
" Uninstalling torch-1.4.0+cpu:\n",
|
| 87 | |
" Successfully uninstalled torch-1.4.0+cpu\n",
|
| 88 | |
" Attempting uninstall: torchvision\n",
|
| 89 | |
" Found existing installation: torchvision 0.5.0+cpu\n",
|
| 90 | |
" Uninstalling torchvision-0.5.0+cpu:\n",
|
| 91 | |
" Successfully uninstalled torchvision-0.5.0+cpu\n",
|
| 92 | |
" Attempting uninstall: tokenizers\n",
|
| 93 | |
" Found existing installation: tokenizers 0.9.4\n",
|
| 94 | |
" Uninstalling tokenizers-0.9.4:\n",
|
| 95 | |
" Successfully uninstalled tokenizers-0.9.4\n",
|
| 96 | |
" Attempting uninstall: transformers\n",
|
| 97 | |
" Found existing installation: transformers 4.1.1\n",
|
| 98 | |
" Uninstalling transformers-4.1.1:\n",
|
| 99 | |
" Successfully uninstalled transformers-4.1.1\n"
|
|
47 |
"Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in /home/jovyan/.virtualenvs/basenv/lib/python3.7/site-packages (from torchvision->timm==0.4.12->-r requirement.txt (line 1)) (8.1.0)\n",
|
|
48 |
"Installing collected packages: timm\n",
|
|
49 |
" Attempting uninstall: timm\n",
|
|
50 |
" Found existing installation: timm 0.5.4\n",
|
|
51 |
" Not uninstalling timm at /home/jovyan/work/.localenv/lib/python3.7/site-packages, outside environment /home/jovyan/.virtualenvs/basenv\n",
|
|
52 |
" Can't uninstall 'timm'. No files were found to uninstall.\n",
|
|
53 |
"Successfully installed timm-0.4.12\n",
|
|
54 |
"\u001b[33mWARNING: You are using pip version 21.1.3; however, version 22.1.2 is available.\n",
|
|
55 |
"You should consider upgrading via the '/home/jovyan/.virtualenvs/basenv/bin/python -m pip install --upgrade pip' command.\u001b[0m\n"
|
| 100 | 56 |
]
|
| 101 | 57 |
}
|
| 102 | 58 |
],
|
|
| 106 | 62 |
},
|
| 107 | 63 |
{
|
| 108 | 64 |
"cell_type": "code",
|
|
65 |
"execution_count": 3,
|
|
66 |
"id": "9c47fb1c",
|
|
67 |
"metadata": {},
|
|
68 |
"outputs": [
|
|
69 |
{
|
|
70 |
"name": "stdout",
|
|
71 |
"output_type": "stream",
|
|
72 |
"text": [
|
|
73 |
"Package Version\n",
|
|
74 |
"----------------------------- ------------\n",
|
|
75 |
"absl-py 0.9.0\n",
|
|
76 |
"alembic 1.7.6\n",
|
|
77 |
"argon2-cffi 21.3.0\n",
|
|
78 |
"argon2-cffi-bindings 21.2.0\n",
|
|
79 |
"astor 0.8.1\n",
|
|
80 |
"asttokens 2.0.5\n",
|
|
81 |
"astunparse 1.6.3\n",
|
|
82 |
"async-generator 1.10\n",
|
|
83 |
"attrs 19.3.0\n",
|
|
84 |
"Augmentor 0.2.8\n",
|
|
85 |
"backcall 0.2.0\n",
|
|
86 |
"baytune 0.3.12\n",
|
|
87 |
"bleach 4.1.0\n",
|
|
88 |
"blis 0.4.1\n",
|
|
89 |
"boto3 1.16.25\n",
|
|
90 |
"botocore 1.19.25\n",
|
|
91 |
"cachetools 3.1.1\n",
|
|
92 |
"cairocffi 1.3.0\n",
|
|
93 |
"CairoSVG 2.5.2\n",
|
|
94 |
"calysto 1.0.6\n",
|
|
95 |
"catalogue 1.0.0\n",
|
|
96 |
"certifi 2021.10.8\n",
|
|
97 |
"certipy 0.1.3\n",
|
|
98 |
"cffi 1.15.0\n",
|
|
99 |
"charset-normalizer 2.0.12\n",
|
|
100 |
"click 8.0.4\n",
|
|
101 |
"cloudpickle 1.2.2\n",
|
|
102 |
"cmake 3.21.1\n",
|
|
103 |
"configparser 5.2.0\n",
|
|
104 |
"copulas 0.3.3\n",
|
|
105 |
"cryptography 36.0.1\n",
|
|
106 |
"cssselect2 0.4.1\n",
|
|
107 |
"cycler 0.11.0\n",
|
|
108 |
"cymem 2.0.6\n",
|
|
109 |
"Cython 0.29.20\n",
|
|
110 |
"debugpy 1.5.1\n",
|
|
111 |
"decorator 5.1.1\n",
|
|
112 |
"defusedxml 0.7.1\n",
|
|
113 |
"distlib 0.3.4\n",
|
|
114 |
"dlib 19.22.0\n",
|
|
115 |
"dm-tree 0.1.6\n",
|
|
116 |
"easydict 1.9\n",
|
|
117 |
"en-core-web-sm 2.3.0\n",
|
|
118 |
"entrypoints 0.4\n",
|
|
119 |
"et-xmlfile 1.1.0\n",
|
|
120 |
"fairscale 0.4.4\n",
|
|
121 |
"filelock 3.6.0\n",
|
|
122 |
"func-timeout 4.3.5\n",
|
|
123 |
"future 0.18.2\n",
|
|
124 |
"gast 0.3.3\n",
|
|
125 |
"gensim 3.8.3\n",
|
|
126 |
"google-auth 2.6.0\n",
|
|
127 |
"google-auth-oauthlib 0.4.6\n",
|
|
128 |
"google-pasta 0.2.0\n",
|
|
129 |
"graphviz 0.14\n",
|
|
130 |
"greenlet 1.1.2\n",
|
|
131 |
"grpcio 1.29.0\n",
|
|
132 |
"gym 0.15.7\n",
|
|
133 |
"h5py 2.10.0\n",
|
|
134 |
"huggingface-hub 0.8.1\n",
|
|
135 |
"idna 3.3\n",
|
|
136 |
"imageio 2.8.0\n",
|
|
137 |
"imbalanced-learn 0.6.2\n",
|
|
138 |
"imgaug 0.4.0\n",
|
|
139 |
"importlib-metadata 4.11.1\n",
|
|
140 |
"importlib-resources 5.4.0\n",
|
|
141 |
"install 1.3.5\n",
|
|
142 |
"ipdb 0.13.2\n",
|
|
143 |
"ipykernel 6.9.1\n",
|
|
144 |
"ipython 7.31.1\n",
|
|
145 |
"ipython-genutils 0.2.0\n",
|
|
146 |
"ipywidgets 7.4.0\n",
|
|
147 |
"jdcal 1.4.1\n",
|
|
148 |
"jedi 0.18.1\n",
|
|
149 |
"jieba 0.42.1\n",
|
|
150 |
"Jinja2 3.0.3\n",
|
|
151 |
"jmespath 0.10.0\n",
|
|
152 |
"joblib 1.1.0\n",
|
|
153 |
"jsonschema 4.4.0\n",
|
|
154 |
"jupyter-client 7.1.2\n",
|
|
155 |
"jupyter-core 4.9.2\n",
|
|
156 |
"jupyter-telemetry 0.1.0\n",
|
|
157 |
"jupyterhub 1.4.2\n",
|
|
158 |
"jupyterlab 1.0.0a1\n",
|
|
159 |
"jupyterlab-server 0.2.0\n",
|
|
160 |
"kanren 0.2.3\n",
|
|
161 |
"Keras 2.4.3\n",
|
|
162 |
"Keras-Preprocessing 1.1.2\n",
|
|
163 |
"kiwisolver 1.3.2\n",
|
|
164 |
"Mako 1.1.6\n",
|
|
165 |
"Markdown 3.3.6\n",
|
|
166 |
"MarkupSafe 2.1.0\n",
|
|
167 |
"matplotlib 3.0.3\n",
|
|
168 |
"matplotlib-inline 0.1.3\n",
|
|
169 |
"metakernel 0.28.2\n",
|
|
170 |
"mindspore 1.0.0\n",
|
|
171 |
"minepy 1.2.4\n",
|
|
172 |
"minio 5.0.10\n",
|
|
173 |
"mistune 0.8.4\n",
|
|
174 |
"mpmath 1.2.1\n",
|
|
175 |
"multipledispatch 0.6.0\n",
|
|
176 |
"murmurhash 1.0.6\n",
|
|
177 |
"nbconvert 5.6.1\n",
|
|
178 |
"nbformat 5.1.3\n",
|
|
179 |
"nest-asyncio 1.5.4\n",
|
|
180 |
"networkx 2.6.3\n",
|
|
181 |
"nltk 3.5\n",
|
|
182 |
"notebook 6.2.0\n",
|
|
183 |
"numpy 1.18.5\n",
|
|
184 |
"numpyencoder 0.3.0\n",
|
|
185 |
"oauthlib 3.2.0\n",
|
|
186 |
"opencv-python 4.5.1.48\n",
|
|
187 |
"openpyxl 2.6.4\n",
|
|
188 |
"opt-einsum 3.3.0\n",
|
|
189 |
"packaging 21.3\n",
|
|
190 |
"paddlepaddle 2.0.1\n",
|
|
191 |
"pamela 1.0.0\n",
|
|
192 |
"pandas 0.24.2\n",
|
|
193 |
"pandocfilters 1.5.0\n",
|
|
194 |
"parso 0.8.3\n",
|
|
195 |
"pbr 5.8.1\n",
|
|
196 |
"pexpect 4.8.0\n",
|
|
197 |
"pickleshare 0.7.5\n",
|
|
198 |
"Pillow 8.1.0\n",
|
|
199 |
"pip 21.1.3\n",
|
|
200 |
"plac 1.1.3\n",
|
|
201 |
"platformdirs 2.5.1\n",
|
|
202 |
"plotly 4.8.1\n",
|
|
203 |
"portpicker 1.3.9\n",
|
|
204 |
"preshed 3.0.6\n",
|
|
205 |
"prometheus-client 0.13.1\n",
|
|
206 |
"prompt-toolkit 3.0.28\n",
|
|
207 |
"protobuf 3.19.4\n",
|
|
208 |
"ptyprocess 0.7.0\n",
|
|
209 |
"pyasn1 0.4.8\n",
|
|
210 |
"pyasn1-modules 0.2.8\n",
|
|
211 |
"PyAudio 0.2.11\n",
|
|
212 |
"pycocoevalcap 1.2\n",
|
|
213 |
"pycocotools 2.0.4\n",
|
|
214 |
"pycparser 2.21\n",
|
|
215 |
"pydot 1.4.1\n",
|
|
216 |
"pygame 2.0.1\n",
|
|
217 |
"pyglet 1.5.0\n",
|
|
218 |
"Pygments 2.11.2\n",
|
|
219 |
"pyOpenSSL 22.0.0\n",
|
|
220 |
"pyparsing 3.0.7\n",
|
|
221 |
"pyrsistent 0.18.1\n",
|
|
222 |
"python-dateutil 2.8.2\n",
|
|
223 |
"python-json-logger 2.0.2\n",
|
|
224 |
"pytorch-pretrained-bert 0.6.2\n",
|
|
225 |
"pytorch-transformers 1.2.0\n",
|
|
226 |
"pytz 2021.3\n",
|
|
227 |
"PyWavelets 1.2.0\n",
|
|
228 |
"PyYAML 6.0\n",
|
|
229 |
"pyzmq 22.3.0\n",
|
|
230 |
"regex 2022.1.18\n",
|
|
231 |
"requests 2.27.1\n",
|
|
232 |
"requests-oauthlib 1.3.1\n",
|
|
233 |
"retrying 1.3.3\n",
|
|
234 |
"rouge 1.0.0\n",
|
|
235 |
"rsa 4.8\n",
|
|
236 |
"ruamel.yaml 0.17.21\n",
|
|
237 |
"ruamel.yaml.clib 0.2.6\n",
|
|
238 |
"s3transfer 0.3.3\n",
|
|
239 |
"sacremoses 0.0.47\n",
|
|
240 |
"scikit-image 0.15.0\n",
|
|
241 |
"scikit-learn 0.22.2.post1\n",
|
|
242 |
"scipy 1.3.3\n",
|
|
243 |
"seaborn 0.10.1\n",
|
|
244 |
"semantic-version 2.8.5\n",
|
|
245 |
"Send2Trash 1.8.0\n",
|
|
246 |
"sentencepiece 0.1.91\n",
|
|
247 |
"setuptools 57.1.0\n",
|
|
248 |
"Shapely 1.7.0\n",
|
|
249 |
"six 1.16.0\n",
|
|
250 |
"smart-open 5.2.1\n",
|
|
251 |
"spacy 2.3.2\n",
|
|
252 |
"SQLAlchemy 1.4.31\n",
|
|
253 |
"srsly 1.0.5\n",
|
|
254 |
"stevedore 3.5.0\n",
|
|
255 |
"svgwrite 1.4.1\n",
|
|
256 |
"sympy 1.6.2\n",
|
|
257 |
"tensorboard 2.8.0\n",
|
|
258 |
"tensorboard-data-server 0.6.1\n",
|
|
259 |
"tensorboard-plugin-wit 1.8.1\n",
|
|
260 |
"tensorboardX 2.0\n",
|
|
261 |
"tensorflow 2.3.1\n",
|
|
262 |
"tensorflow-addons 0.11.2\n",
|
|
263 |
"tensorflow-estimator 2.3.0\n",
|
|
264 |
"tensorflow-federated 0.17.0\n",
|
|
265 |
"tensorflow-model-optimization 0.4.1\n",
|
|
266 |
"tensorflow-privacy 0.5.2\n",
|
|
267 |
"termcolor 1.1.0\n",
|
|
268 |
"terminado 0.13.1\n",
|
|
269 |
"testpath 0.5.0\n",
|
|
270 |
"tf-slim 1.1.0\n",
|
|
271 |
"thinc 7.4.1\n",
|
|
272 |
"timm 0.4.12\n",
|
|
273 |
"tinycss2 1.1.1\n",
|
|
274 |
"tokenizers 0.10.3\n",
|
|
275 |
"toolz 0.11.2\n",
|
|
276 |
"torch 1.11.0\n",
|
|
277 |
"torchtext 0.6.0\n",
|
|
278 |
"torchvision 0.12.0\n",
|
|
279 |
"tornado 6.1\n",
|
|
280 |
"tqdm 4.46.1\n",
|
|
281 |
"traitlets 5.1.1\n",
|
|
282 |
"transformers 4.15.0\n",
|
|
283 |
"typeguard 2.13.3\n",
|
|
284 |
"typing-extensions 4.1.1\n",
|
|
285 |
"unification 0.2.2\n",
|
|
286 |
"urllib3 1.26.8\n",
|
|
287 |
"virtualenv 20.13.1\n",
|
|
288 |
"virtualenv-clone 0.5.7\n",
|
|
289 |
"virtualenvwrapper 4.7.0\n",
|
|
290 |
"wasabi 0.9.0\n",
|
|
291 |
"wcwidth 0.2.5\n",
|
|
292 |
"webencodings 0.5.1\n",
|
|
293 |
"Werkzeug 2.0.3\n",
|
|
294 |
"wheel 0.36.2\n",
|
|
295 |
"widgetsnbextension 3.4.2\n",
|
|
296 |
"word2vec 0.11.1\n",
|
|
297 |
"wrapt 1.13.3\n",
|
|
298 |
"xlrd 1.2.0\n",
|
|
299 |
"XlsxWriter 1.4.3\n",
|
|
300 |
"yellowbrick 1.1\n",
|
|
301 |
"zipp 3.7.0\n",
|
|
302 |
"\u001b[33mWARNING: You are using pip version 21.1.3; however, version 22.1.2 is available.\n",
|
|
303 |
"You should consider upgrading via the '/home/jovyan/work/.localenv/bin/python -m pip install --upgrade pip' command.\u001b[0m\n"
|
|
304 |
]
|
|
305 |
}
|
|
306 |
],
|
|
307 |
"source": [
|
|
308 |
"! pip list\n"
|
|
309 |
]
|
|
310 |
},
|
|
311 |
{
|
|
312 |
"cell_type": "code",
|
|
313 |
"execution_count": 1,
|
|
314 |
"id": "c2181ede",
|
|
315 |
"metadata": {},
|
|
316 |
"outputs": [
|
|
317 |
{
|
|
318 |
"ename": "ConnectionError",
|
|
319 |
"evalue": "HTTPSConnectionPool(host='mo.zju.edu.cn', port=443): Max retries exceeded with url: /pyapi/file/temp_api_file (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f7d07fedf50>: Failed to establish a new connection: [Errno 110] Connection timed out'))",
|
|
320 |
"output_type": "error",
|
|
321 |
"traceback": [
|
|
322 |
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
|
323 |
"\u001b[0;31mTimeoutError\u001b[0m Traceback (most recent call last)",
|
|
324 |
"\u001b[0;32m/usr/local/lib/python3.7/dist-packages/urllib3/connection.py\u001b[0m in \u001b[0;36m_new_conn\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 174\u001b[0m conn = connection.create_connection(\n\u001b[0;32m--> 175\u001b[0;31m \u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_dns_host\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mport\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtimeout\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mextra_kw\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 176\u001b[0m )\n",
|
|
325 |
"\u001b[0;32m/usr/local/lib/python3.7/dist-packages/urllib3/util/connection.py\u001b[0m in \u001b[0;36mcreate_connection\u001b[0;34m(address, timeout, source_address, socket_options)\u001b[0m\n\u001b[1;32m 94\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0merr\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 95\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0merr\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 96\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
|
326 |
"\u001b[0;32m/usr/local/lib/python3.7/dist-packages/urllib3/util/connection.py\u001b[0m in \u001b[0;36mcreate_connection\u001b[0;34m(address, timeout, source_address, socket_options)\u001b[0m\n\u001b[1;32m 84\u001b[0m \u001b[0msock\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbind\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msource_address\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 85\u001b[0;31m \u001b[0msock\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconnect\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msa\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 86\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0msock\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
|
327 |
"\u001b[0;31mTimeoutError\u001b[0m: [Errno 110] Connection timed out",
|
|
328 |
"\nDuring handling of the above exception, another exception occurred:\n",
|
|
329 |
"\u001b[0;31mNewConnectionError\u001b[0m Traceback (most recent call last)",
|
|
330 |
"\u001b[0;32m/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py\u001b[0m in \u001b[0;36murlopen\u001b[0;34m(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)\u001b[0m\n\u001b[1;32m 709\u001b[0m \u001b[0mheaders\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mheaders\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 710\u001b[0;31m \u001b[0mchunked\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mchunked\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 711\u001b[0m )\n",
|
|
331 |
"\u001b[0;32m/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py\u001b[0m in \u001b[0;36m_make_request\u001b[0;34m(self, conn, method, url, timeout, chunked, **httplib_request_kw)\u001b[0m\n\u001b[1;32m 385\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 386\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_validate_conn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconn\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 387\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mSocketTimeout\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mBaseSSLError\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
|
332 |
"\u001b[0;32m/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py\u001b[0m in \u001b[0;36m_validate_conn\u001b[0;34m(self, conn)\u001b[0m\n\u001b[1;32m 1039\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconn\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"sock\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;31m# AppEngine might not have `.sock`\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1040\u001b[0;31m \u001b[0mconn\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconnect\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1041\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
|
333 |
"\u001b[0;32m/usr/local/lib/python3.7/dist-packages/urllib3/connection.py\u001b[0m in \u001b[0;36mconnect\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 357\u001b[0m \u001b[0;31m# Add certificate verification\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 358\u001b[0;31m \u001b[0mconn\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_new_conn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 359\u001b[0m \u001b[0mhostname\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhost\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
|
334 |
"\u001b[0;32m/usr/local/lib/python3.7/dist-packages/urllib3/connection.py\u001b[0m in \u001b[0;36m_new_conn\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 186\u001b[0m raise NewConnectionError(\n\u001b[0;32m--> 187\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"Failed to establish a new connection: %s\"\u001b[0m \u001b[0;34m%\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 188\u001b[0m )\n",
|
|
335 |
"\u001b[0;31mNewConnectionError\u001b[0m: <urllib3.connection.HTTPSConnection object at 0x7f7d07fedf50>: Failed to establish a new connection: [Errno 110] Connection timed out",
|
|
336 |
"\nDuring handling of the above exception, another exception occurred:\n",
|
|
337 |
"\u001b[0;31mMaxRetryError\u001b[0m Traceback (most recent call last)",
|
|
338 |
"\u001b[0;32m/usr/local/lib/python3.7/dist-packages/requests/adapters.py\u001b[0m in \u001b[0;36msend\u001b[0;34m(self, request, stream, timeout, verify, cert, proxies)\u001b[0m\n\u001b[1;32m 449\u001b[0m \u001b[0mretries\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmax_retries\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 450\u001b[0;31m \u001b[0mtimeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtimeout\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 451\u001b[0m )\n",
|
|
339 |
"\u001b[0;32m/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py\u001b[0m in \u001b[0;36murlopen\u001b[0;34m(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)\u001b[0m\n\u001b[1;32m 785\u001b[0m retries = retries.increment(\n\u001b[0;32m--> 786\u001b[0;31m \u001b[0mmethod\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0murl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0merror\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0me\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_pool\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_stacktrace\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msys\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexc_info\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 787\u001b[0m )\n",
|
|
340 |
"\u001b[0;32m/usr/local/lib/python3.7/dist-packages/urllib3/util/retry.py\u001b[0m in \u001b[0;36mincrement\u001b[0;34m(self, method, url, response, error, _pool, _stacktrace)\u001b[0m\n\u001b[1;32m 591\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mnew_retry\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_exhausted\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 592\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mMaxRetryError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_pool\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0murl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0merror\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mResponseError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcause\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 593\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
|
341 |
"\u001b[0;31mMaxRetryError\u001b[0m: HTTPSConnectionPool(host='mo.zju.edu.cn', port=443): Max retries exceeded with url: /pyapi/file/temp_api_file (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f7d07fedf50>: Failed to establish a new connection: [Errno 110] Connection timed out'))",
|
|
342 |
"\nDuring handling of the above exception, another exception occurred:\n",
|
|
343 |
"\u001b[0;31mConnectionError\u001b[0m Traceback (most recent call last)",
|
|
344 |
"\u001b[0;32m/tmp/ipykernel_374/4271832855.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mupload_url\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'https://mo.zju.edu.cn/pyapi/file/temp_api_file'\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0mPhoto_file\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m{\u001b[0m\u001b[0;34m'file'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'./img/demo.jpg'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'rb'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 6\u001b[0;31m \u001b[0mPhoto_file_name\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mrequests\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpost\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mupload_url\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfiles\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mPhoto_file\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjson\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'temp_file_name'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 7\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
|
345 |
"\u001b[0;32m/usr/local/lib/python3.7/dist-packages/requests/api.py\u001b[0m in \u001b[0;36mpost\u001b[0;34m(url, data, json, **kwargs)\u001b[0m\n\u001b[1;32m 115\u001b[0m \"\"\"\n\u001b[1;32m 116\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 117\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mrequest\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'post'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0murl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mjson\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mjson\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 118\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 119\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
|
346 |
"\u001b[0;32m/usr/local/lib/python3.7/dist-packages/requests/api.py\u001b[0m in \u001b[0;36mrequest\u001b[0;34m(method, url, **kwargs)\u001b[0m\n\u001b[1;32m 59\u001b[0m \u001b[0;31m# cases, and look like a memory leak in others.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 60\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0msessions\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mSession\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0msession\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 61\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0msession\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrequest\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmethod\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmethod\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0murl\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0murl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 62\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 63\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
|
|
347 |
"\u001b[0;32m/usr/local/lib/python3.7/dist-packages/requests/sessions.py\u001b[0m in \u001b[0;36mrequest\u001b[0;34m(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)\u001b[0m\n\u001b[1;32m 527\u001b[0m }\n\u001b[1;32m 528\u001b[0m \u001b[0msend_kwargs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mupdate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msettings\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 529\u001b[0;31m \u001b[0mresp\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mprep\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0msend_kwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 530\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 531\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresp\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
|
348 |
"\u001b[0;32m/usr/local/lib/python3.7/dist-packages/requests/sessions.py\u001b[0m in \u001b[0;36msend\u001b[0;34m(self, request, **kwargs)\u001b[0m\n\u001b[1;32m 643\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 644\u001b[0m \u001b[0;31m# Send the request\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 645\u001b[0;31m \u001b[0mr\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0madapter\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrequest\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 646\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 647\u001b[0m \u001b[0;31m# Total elapsed time of the request (approximately)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
|
349 |
"\u001b[0;32m/usr/local/lib/python3.7/dist-packages/requests/adapters.py\u001b[0m in \u001b[0;36msend\u001b[0;34m(self, request, stream, timeout, verify, cert, proxies)\u001b[0m\n\u001b[1;32m 517\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mSSLError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0me\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrequest\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mrequest\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 518\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 519\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mConnectionError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0me\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrequest\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mrequest\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 520\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 521\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mClosedPoolError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
|
350 |
"\u001b[0;31mConnectionError\u001b[0m: HTTPSConnectionPool(host='mo.zju.edu.cn', port=443): Max retries exceeded with url: /pyapi/file/temp_api_file (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f7d07fedf50>: Failed to establish a new connection: [Errno 110] Connection timed out'))"
|
|
351 |
]
|
|
352 |
}
|
|
353 |
],
|
|
354 |
"source": [
|
|
355 |
"import requests\n",
|
|
356 |
"\n",
|
|
357 |
"# 先将文件上传至文件存储(此存储为临时用,一小时后文件即会被删除)\n",
|
|
358 |
"upload_url = 'https://mo.zju.edu.cn/pyapi/file/temp_api_file'\n",
|
|
359 |
"Photo_file = {'file': open('./img/demo.jpg', 'rb')}\n",
|
|
360 |
"Photo_file_name = requests.post(upload_url, files=Photo_file).json().get('temp_file_name')"
|
|
361 |
]
|
|
362 |
},
|
|
363 |
{
|
|
364 |
"cell_type": "code",
|
| 109 | 365 |
"execution_count": null,
|
| 110 | |
"id": "2f197046",
|
|
366 |
"id": "de60afb6",
|
| 111 | 367 |
"metadata": {},
|
| 112 | 368 |
"outputs": [],
|
| 113 | |
"source": []
|
|
369 |
"source": [
|
|
370 |
"base_url = \"https://mo.zju.edu.cn/pyapi/apps/run/\"\n",
|
|
371 |
"app_id = \"62b12fde34514bed5c29038b\"\n",
|
|
372 |
"input_dic = {\"Photo\": {\"val\": Photo_file_name, \"type\": \"img\"}, \"Question\": {\"val\": \"<fill_with_str>\", \"type\": \"str\"}}\n",
|
|
373 |
"output_dic = {\"Answer\": {\"type\": \"str\"}}\n",
|
|
374 |
"app_version = \"0-3-0\"\n",
|
|
375 |
"payload = {\"app\": {\"input\": input_dic, \"output\": output_dic}, \"version\": app_version}\n",
|
|
376 |
"response = requests.post(base_url + app_id, json=payload)\n",
|
|
377 |
"print(response.json())"
|
|
378 |
]
|
| 114 | 379 |
}
|
| 115 | 380 |
],
|
| 116 | 381 |
"metadata": {
|