* modified module_path

* updated tensorboard section

* rerun notebook

* only submit local run if python path is found

* minor change and rerun notebook

Former-commit-id: 9f25f3acb8
This commit is contained in:
Chenhui Hu 2020-04-05 22:40:25 -04:00 коммит произвёл GitHub
Родитель c52fb1c83d
Коммит 85452929f7
3 изменённых файлов: 197 добавлений и 228 удалений

Просмотреть файл

@ -50,7 +50,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"System version: 3.6.10 |Anaconda, Inc.| (default, Jan 7 2020, 21:14:29) \n",
"System version: 3.6.10 |Anaconda, Inc.| (default, Mar 23 2020, 23:13:11) \n",
"[GCC 7.3.0]\n",
"TensorFlow version: 2.0.0\n"
]
@ -173,7 +173,16 @@
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Data already exists at the specified location.\n",
"Finished data downloading and splitting.\n"
]
}
],
"source": [
"if DOWNLOAD_SPLIT_DATA:\n",
" download_ojdata(DATA_DIR)\n",
@ -419,110 +428,108 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Removed existing log directory logs/scalars/ \n",
"\n",
"---- Round 1 ----\n",
"Train on 72127 samples\n",
"Epoch 1/25\n",
"71936/72127 [============================>.] - ETA: 0s - loss: 56.5318 - mape: 56.5318 - mae: 7722.4761\n",
"71616/72127 [============================>.] - ETA: 0s - loss: 56.5520 - mape: 56.5520 - mae: 7724.2822\n",
"Epoch 00001: loss improved from inf to 56.51509, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 5s 69us/sample - loss: 56.5151 - mape: 56.5151 - mae: 7720.3770\n",
"72127/72127 [==============================] - 6s 84us/sample - loss: 56.5151 - mape: 56.5151 - mae: 7720.3770\n",
"Epoch 2/25\n",
"71552/72127 [============================>.] - ETA: 0s - loss: 47.1688 - mape: 47.1687 - mae: 7010.7603\n",
"71808/72127 [============================>.] - ETA: 0s - loss: 47.1695 - mape: 47.1694 - mae: 7017.5864\n",
"Epoch 00002: loss improved from 56.51509 to 47.16605, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 51us/sample - loss: 47.1660 - mape: 47.1660 - mae: 7016.5732\n",
"72127/72127 [==============================] - 4s 49us/sample - loss: 47.1660 - mape: 47.1660 - mae: 7016.5732\n",
"Epoch 3/25\n",
"71424/72127 [============================>.] - ETA: 0s - loss: 45.7352 - mape: 45.7351 - mae: 6851.6602\n",
"71808/72127 [============================>.] - ETA: 0s - loss: 45.7213 - mape: 45.7213 - mae: 6850.9878\n",
"Epoch 00003: loss improved from 47.16605 to 45.71347, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 51us/sample - loss: 45.7135 - mape: 45.7135 - mae: 6850.3550\n",
"72127/72127 [==============================] - 4s 50us/sample - loss: 45.7135 - mape: 45.7135 - mae: 6850.3550\n",
"Epoch 4/25\n",
"71232/72127 [============================>.] - ETA: 0s - loss: 44.6689 - mape: 44.6689 - mae: 6717.1387\n",
"71424/72127 [============================>.] - ETA: 0s - loss: 44.6667 - mape: 44.6667 - mae: 6717.0830\n",
"Epoch 00004: loss improved from 45.71347 to 44.66833, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 51us/sample - loss: 44.6683 - mape: 44.6683 - mae: 6713.0122\n",
"72127/72127 [==============================] - 4s 49us/sample - loss: 44.6683 - mape: 44.6683 - mae: 6713.0122\n",
"Epoch 5/25\n",
"71872/72127 [============================>.] - ETA: 0s - loss: 43.2161 - mape: 43.2161 - mae: 6511.9297\n",
"71616/72127 [============================>.] - ETA: 0s - loss: 43.2272 - mape: 43.2272 - mae: 6515.4497\n",
"Epoch 00005: loss improved from 44.66833 to 43.20723, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 50us/sample - loss: 43.2072 - mape: 43.2072 - mae: 6508.6270\n",
"72127/72127 [==============================] - 4s 49us/sample - loss: 43.2072 - mape: 43.2072 - mae: 6508.6270\n",
"Epoch 6/25\n",
"71616/72127 [============================>.] - ETA: 0s - loss: 41.1310 - mape: 41.1310 - mae: 6276.9038\n",
"71552/72127 [============================>.] - ETA: 0s - loss: 41.1341 - mape: 41.1341 - mae: 6276.3589\n",
"Epoch 00006: loss improved from 43.20723 to 41.13340, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 51us/sample - loss: 41.1334 - mape: 41.1334 - mae: 6273.2939\n",
"72127/72127 [==============================] - 4s 50us/sample - loss: 41.1334 - mape: 41.1334 - mae: 6273.2939\n",
"Epoch 7/25\n",
"71488/72127 [============================>.] - ETA: 0s - loss: 39.7952 - mape: 39.7952 - mae: 6085.1465\n",
"71744/72127 [============================>.] - ETA: 0s - loss: 39.7776 - mape: 39.7776 - mae: 6087.9951\n",
"Epoch 00007: loss improved from 41.13340 to 39.76846, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 51us/sample - loss: 39.7685 - mape: 39.7685 - mae: 6086.8159\n",
"72127/72127 [==============================] - 4s 50us/sample - loss: 39.7685 - mape: 39.7685 - mae: 6086.8159\n",
"Epoch 8/25\n",
"71936/72127 [============================>.] - ETA: 0s - loss: 38.4604 - mape: 38.4604 - mae: 5855.5146\n",
"72064/72127 [============================>.] - ETA: 0s - loss: 38.4566 - mape: 38.4566 - mae: 5858.4277\n",
"Epoch 00008: loss improved from 39.76846 to 38.45820, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 50us/sample - loss: 38.4582 - mape: 38.4582 - mae: 5857.4014\n",
"Epoch 9/25\n",
"71808/72127 [============================>.] - ETA: 0s - loss: 37.5734 - mape: 37.5734 - mae: 5705.5396\n",
"Epoch 00009: loss improved from 38.45820 to 37.58665, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 51us/sample - loss: 37.5866 - mape: 37.5867 - mae: 5701.1484\n",
"72127/72127 [==============================] - 4s 49us/sample - loss: 37.5866 - mape: 37.5867 - mae: 5701.1484\n",
"Epoch 10/25\n",
"71232/72127 [============================>.] - ETA: 0s - loss: 37.2455 - mape: 37.2455 - mae: 5592.3276\n",
"72064/72127 [============================>.] - ETA: 0s - loss: 37.2489 - mape: 37.2489 - mae: 5598.1396\n",
"Epoch 00010: loss improved from 37.58665 to 37.24802, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 51us/sample - loss: 37.2480 - mape: 37.2480 - mae: 5596.7349\n",
"72127/72127 [==============================] - 4s 49us/sample - loss: 37.2480 - mape: 37.2480 - mae: 5596.7349\n",
"Epoch 11/25\n",
"71616/72127 [============================>.] - ETA: 0s - loss: 36.7460 - mape: 36.7460 - mae: 5494.0991\n",
"71680/72127 [============================>.] - ETA: 0s - loss: 36.7482 - mape: 36.7482 - mae: 5497.1836\n",
"Epoch 00011: loss improved from 37.24802 to 36.74330, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 51us/sample - loss: 36.7433 - mape: 36.7433 - mae: 5500.9717\n",
"72127/72127 [==============================] - 4s 50us/sample - loss: 36.7433 - mape: 36.7433 - mae: 5500.9717\n",
"Epoch 12/25\n",
"71296/72127 [============================>.] - ETA: 0s - loss: 36.4270 - mape: 36.4270 - mae: 5433.4595\n",
"71360/72127 [============================>.] - ETA: 0s - loss: 36.4275 - mape: 36.4275 - mae: 5431.5015\n",
"Epoch 00012: loss improved from 36.74330 to 36.41299, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 51us/sample - loss: 36.4130 - mape: 36.4130 - mae: 5432.9189\n",
"72127/72127 [==============================] - 4s 49us/sample - loss: 36.4130 - mape: 36.4130 - mae: 5432.9189\n",
"Epoch 13/25\n",
"71424/72127 [============================>.] - ETA: 0s - loss: 36.1672 - mape: 36.1672 - mae: 5388.6860\n",
"71104/72127 [============================>.] - ETA: 0s - loss: 36.1517 - mape: 36.1517 - mae: 5387.0752\n",
"Epoch 00013: loss improved from 36.41299 to 36.15361, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 51us/sample - loss: 36.1536 - mape: 36.1536 - mae: 5391.8271\n",
"72127/72127 [==============================] - 4s 49us/sample - loss: 36.1536 - mape: 36.1536 - mae: 5391.8271\n",
"Epoch 14/25\n",
"71360/72127 [============================>.] - ETA: 0s - loss: 35.9492 - mape: 35.9492 - mae: 5347.9229\n",
"71808/72127 [============================>.] - ETA: 0s - loss: 35.9469 - mape: 35.9469 - mae: 5346.2378\n",
"Epoch 00014: loss improved from 36.15361 to 35.94919, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 51us/sample - loss: 35.9492 - mape: 35.9492 - mae: 5343.6650\n",
"72127/72127 [==============================] - 4s 50us/sample - loss: 35.9492 - mape: 35.9492 - mae: 5343.6650\n",
"Epoch 15/25\n",
"71616/72127 [============================>.] - ETA: 0s - loss: 35.8808 - mape: 35.8808 - mae: 5296.1387\n",
"71424/72127 [============================>.] - ETA: 0s - loss: 35.8748 - mape: 35.8748 - mae: 5292.9468\n",
"Epoch 00015: loss improved from 35.94919 to 35.88297, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 51us/sample - loss: 35.8830 - mape: 35.8830 - mae: 5301.1138\n",
"72127/72127 [==============================] - 4s 50us/sample - loss: 35.8830 - mape: 35.8830 - mae: 5301.1138\n",
"Epoch 16/25\n",
"71296/72127 [============================>.] - ETA: 0s - loss: 35.7029 - mape: 35.7029 - mae: 5275.5552\n",
"72000/72127 [============================>.] - ETA: 0s - loss: 35.7022 - mape: 35.7022 - mae: 5275.9946\n",
"Epoch 00016: loss improved from 35.88297 to 35.69789, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 51us/sample - loss: 35.6979 - mape: 35.6979 - mae: 5275.7202\n",
"72127/72127 [==============================] - 4s 49us/sample - loss: 35.6979 - mape: 35.6979 - mae: 5275.7202\n",
"Epoch 17/25\n",
"71488/72127 [============================>.] - ETA: 0s - loss: 35.5008 - mape: 35.5008 - mae: 5249.6968\n",
"71040/72127 [============================>.] - ETA: 0s - loss: 35.5128 - mape: 35.5128 - mae: 5253.6084\n",
"Epoch 00017: loss improved from 35.69789 to 35.48755, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 51us/sample - loss: 35.4876 - mape: 35.4876 - mae: 5249.2109\n",
"72127/72127 [==============================] - 4s 49us/sample - loss: 35.4876 - mape: 35.4876 - mae: 5249.2109\n",
"Epoch 18/25\n",
"71552/72127 [============================>.] - ETA: 0s - loss: 35.4433 - mape: 35.4433 - mae: 5226.2476\n",
"71424/72127 [============================>.] - ETA: 0s - loss: 35.4470 - mape: 35.4470 - mae: 5227.4438\n",
"Epoch 00018: loss improved from 35.48755 to 35.42664, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 51us/sample - loss: 35.4266 - mape: 35.4267 - mae: 5216.9648\n",
"72127/72127 [==============================] - 4s 49us/sample - loss: 35.4266 - mape: 35.4267 - mae: 5216.9648\n",
"Epoch 19/25\n",
"71168/72127 [============================>.] - ETA: 0s - loss: 35.3398 - mape: 35.3398 - mae: 5183.7534\n",
"71488/72127 [============================>.] - ETA: 0s - loss: 35.3327 - mape: 35.3327 - mae: 5182.2876\n",
"Epoch 00019: loss improved from 35.42664 to 35.33811, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 50us/sample - loss: 35.3381 - mape: 35.3381 - mae: 5188.2520\n",
"72127/72127 [==============================] - 4s 49us/sample - loss: 35.3381 - mape: 35.3381 - mae: 5188.2520\n",
"Epoch 20/25\n",
"71296/72127 [============================>.] - ETA: 0s - loss: 35.4955 - mape: 35.4956 - mae: 5196.7739\n",
"71104/72127 [============================>.] - ETA: 0s - loss: 35.5015 - mape: 35.5016 - mae: 5198.1392\n",
"Epoch 00020: loss did not improve from 35.33811\n",
"72127/72127 [==============================] - 4s 51us/sample - loss: 35.4936 - mape: 35.4936 - mae: 5191.4199\n",
"72127/72127 [==============================] - 4s 49us/sample - loss: 35.4936 - mape: 35.4936 - mae: 5191.4199\n",
"Epoch 21/25\n",
"71168/72127 [============================>.] - ETA: 0s - loss: 35.1906 - mape: 35.1906 - mae: 5151.5015\n",
"71872/72127 [============================>.] - ETA: 0s - loss: 35.1813 - mape: 35.1813 - mae: 5150.4614\n",
"Epoch 00021: loss improved from 35.33811 to 35.18649, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 51us/sample - loss: 35.1865 - mape: 35.1865 - mae: 5162.1743\n",
"72127/72127 [==============================] - 4s 50us/sample - loss: 35.1865 - mape: 35.1865 - mae: 5162.1743\n",
"Epoch 22/25\n",
"71936/72127 [============================>.] - ETA: 0s - loss: 35.1671 - mape: 35.1671 - mae: 5121.4424\n",
"71744/72127 [============================>.] - ETA: 0s - loss: 35.1639 - mape: 35.1639 - mae: 5124.0410\n",
"Epoch 00022: loss improved from 35.18649 to 35.16992, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 50us/sample - loss: 35.1699 - mape: 35.1699 - mae: 5127.2227\n",
"72127/72127 [==============================] - 4s 49us/sample - loss: 35.1699 - mape: 35.1699 - mae: 5127.2227\n",
"Epoch 23/25\n",
"71552/72127 [============================>.] - ETA: 0s - loss: 35.0816 - mape: 35.0816 - mae: 5112.4053\n",
"72000/72127 [============================>.] - ETA: 0s - loss: 35.0720 - mape: 35.0720 - mae: 5120.6782\n",
"Epoch 00023: loss improved from 35.16992 to 35.06942, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 51us/sample - loss: 35.0694 - mape: 35.0694 - mae: 5118.3569\n",
"72127/72127 [==============================] - 4s 50us/sample - loss: 35.0694 - mape: 35.0694 - mae: 5118.3569\n",
"Epoch 24/25\n",
"71744/72127 [============================>.] - ETA: 0s - loss: 35.0658 - mape: 35.0658 - mae: 5103.3188\n",
"71680/72127 [============================>.] - ETA: 0s - loss: 35.0583 - mape: 35.0583 - mae: 5102.2280\n",
"Epoch 00024: loss improved from 35.06942 to 35.06686, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 51us/sample - loss: 35.0669 - mape: 35.0669 - mae: 5103.9692\n",
"72127/72127 [==============================] - 4s 50us/sample - loss: 35.0669 - mape: 35.0669 - mae: 5103.9692\n",
"Epoch 25/25\n",
"71104/72127 [============================>.] - ETA: 0s - loss: 34.9206 - mape: 34.9206 - mae: 5064.9380\n",
"71488/72127 [============================>.] - ETA: 0s - loss: 34.9209 - mape: 34.9209 - mae: 5069.0962\n",
"Epoch 00025: loss improved from 35.06686 to 34.92286, saving model to dcnn_model.h5\n",
"72127/72127 [==============================] - 4s 51us/sample - loss: 34.9229 - mape: 34.9228 - mae: 5068.9219\n",
"72127/72127 [==============================] - 4s 49us/sample - loss: 34.9229 - mape: 34.9228 - mae: 5068.9219\n",
"\n",
" Prediction results:\n",
" store brand week round prediction\n",
@ -534,9 +541,15 @@
"\n",
"---- Round 2 ----\n",
"Train on 35607 samples\n",
"35584/35607 [============================>.] - ETA: 0s - loss: 33.9328 - mape: 33.9328 - mae: 5310.8218\n",
"Epoch 00001: loss improved from inf to 33.92596, saving model to dcnn_model.h5\n",
"35607/35607 [==============================] - 2s 66us/sample - loss: 33.9260 - mape: 33.9260 - mae: 5309.5166\n",
"35264/35607 [============================>.] - ETA: 0s - loss: 33.9054 - mape: 33.9054 - mae: 5311.6572\n",
"Epoch 00001: loss improved from inf to 33.92596, saving model to dcnn_model.h5\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"35607/35607 [==============================] - 2s 70us/sample - loss: 33.9260 - mape: 33.9260 - mae: 5309.5166\n",
"\n",
" Prediction results:\n",
" store brand week round prediction\n",
@ -548,9 +561,9 @@
"\n",
"---- Round 3 ----\n",
"Train on 35607 samples\n",
"34880/35607 [============================>.] - ETA: 0s - loss: 33.5111 - mape: 33.5112 - mae: 5125.2783\n",
"34752/35607 [============================>.] - ETA: 0s - loss: 33.5213 - mape: 33.5213 - mae: 5126.2217\n",
"Epoch 00001: loss improved from inf to 33.46539, saving model to dcnn_model.h5\n",
"35607/35607 [==============================] - 2s 66us/sample - loss: 33.4654 - mape: 33.4654 - mae: 5107.3125\n",
"35607/35607 [==============================] - 3s 72us/sample - loss: 33.4654 - mape: 33.4654 - mae: 5107.3125\n",
"\n",
" Prediction results:\n",
" store brand week round prediction\n",
@ -564,7 +577,7 @@
"Train on 35607 samples\n",
"35200/35607 [============================>.] - ETA: 0s - loss: 33.2054 - mape: 33.2054 - mae: 5057.2705\n",
"Epoch 00001: loss improved from inf to 33.20649, saving model to dcnn_model.h5\n",
"35607/35607 [==============================] - 3s 72us/sample - loss: 33.2065 - mape: 33.2065 - mae: 5055.4448\n",
"35607/35607 [==============================] - 2s 65us/sample - loss: 33.2065 - mape: 33.2065 - mae: 5055.4448\n",
"\n",
" Prediction results:\n",
" store brand week round prediction\n",
@ -590,7 +603,7 @@
"\n",
"---- Round 6 ----\n",
"Train on 35607 samples\n",
"34752/35607 [============================>.] - ETA: 0s - loss: 33.1319 - mape: 33.1319 - mae: 5125.1406\n",
"34816/35607 [============================>.] - ETA: 0s - loss: 33.1314 - mape: 33.1314 - mae: 5129.1152\n",
"Epoch 00001: loss improved from inf to 33.11792, saving model to dcnn_model.h5\n",
"35607/35607 [==============================] - 2s 66us/sample - loss: 33.1179 - mape: 33.1179 - mae: 5124.7051\n",
"\n",
@ -604,9 +617,9 @@
"\n",
"---- Round 7 ----\n",
"Train on 35607 samples\n",
"35136/35607 [============================>.] - ETA: 0s - loss: 33.1427 - mape: 33.1427 - mae: 5122.4180\n",
"35008/35607 [============================>.] - ETA: 0s - loss: 33.1471 - mape: 33.1471 - mae: 5115.1094\n",
"Epoch 00001: loss improved from inf to 33.11932, saving model to dcnn_model.h5\n",
"35607/35607 [==============================] - 2s 65us/sample - loss: 33.1193 - mape: 33.1193 - mae: 5113.9355\n",
"35607/35607 [==============================] - 2s 66us/sample - loss: 33.1193 - mape: 33.1193 - mae: 5113.9355\n",
"\n",
" Prediction results:\n",
" store brand week round prediction\n",
@ -618,9 +631,9 @@
"\n",
"---- Round 8 ----\n",
"Train on 35607 samples\n",
"34816/35607 [============================>.] - ETA: 0s - loss: 33.2222 - mape: 33.2222 - mae: 4974.2480\n",
"35392/35607 [============================>.] - ETA: 0s - loss: 33.1963 - mape: 33.1963 - mae: 4968.2534\n",
"Epoch 00001: loss improved from inf to 33.17502, saving model to dcnn_model.h5\n",
"35607/35607 [==============================] - 2s 65us/sample - loss: 33.1750 - mape: 33.1750 - mae: 4969.2456\n",
"35607/35607 [==============================] - 2s 67us/sample - loss: 33.1750 - mape: 33.1750 - mae: 4969.2456\n",
"\n",
" Prediction results:\n",
" store brand week round prediction\n",
@ -632,9 +645,9 @@
"\n",
"---- Round 9 ----\n",
"Train on 35607 samples\n",
"35008/35607 [============================>.] - ETA: 0s - loss: 33.0949 - mape: 33.0949 - mae: 4766.9580\n",
"34880/35607 [============================>.] - ETA: 0s - loss: 33.0961 - mape: 33.0961 - mae: 4771.2114\n",
"Epoch 00001: loss improved from inf to 33.10128, saving model to dcnn_model.h5\n",
"35607/35607 [==============================] - 2s 65us/sample - loss: 33.1013 - mape: 33.1013 - mae: 4765.5112\n",
"35607/35607 [==============================] - 2s 67us/sample - loss: 33.1013 - mape: 33.1013 - mae: 4765.5112\n",
"\n",
" Prediction results:\n",
" store brand week round prediction\n",
@ -646,7 +659,7 @@
"\n",
"---- Round 10 ----\n",
"Train on 35607 samples\n",
"34944/35607 [============================>.] - ETA: 0s - loss: 33.3798 - mape: 33.3798 - mae: 4858.0430\n",
"35392/35607 [============================>.] - ETA: 0s - loss: 33.3706 - mape: 33.3706 - mae: 4863.7505\n",
"Epoch 00001: loss improved from inf to 33.35374, saving model to dcnn_model.h5\n",
"35607/35607 [==============================] - 2s 65us/sample - loss: 33.3537 - mape: 33.3537 - mae: 4861.4824\n",
"\n",
@ -658,8 +671,8 @@
"3 2 2 156 10 6416.0\n",
"4 2 3 155 10 2555.0\n",
"\n",
"CPU times: user 6min 50s, sys: 25.1 s, total: 7min 15s\n",
"Wall time: 4min 37s\n"
"CPU times: user 6min 43s, sys: 25.5 s, total: 7min 9s\n",
"Wall time: 4min 35s\n"
]
}
],
@ -753,9 +766,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### TensorBoard Monitor\n",
"### TensorBoard Monitor (Optional)\n",
"\n",
"We can monitor the model training process from TensorBoard. To view the TensorBoard, you will need to forward port 6008 to your local machine via `ssh <user-name>@<remote-vm-ip-address> -L 6008:localhost:6008` if you're running this notebook in a remote VW. On the Tensorboard, you will see a dashboard similar to the following one:\n",
"We can monitor the model training process from TensorBoard. In the cell below, please switch `CHECK_TENSORBOARD` to True if you want to do so. Note that the following cell will try to find the path of the TensorBoard binary if it is not specified. In case the path can't be found, you can run `which tensorboard` (for Linux) or `where tensorboard` (for Windows) from a terminal where `forecasting_env` is activated to look for the path and replace the TensorBoard path in the second line of the code with the path that you find. \n",
"\n",
"To view the TensorBoard, you will need to forward port 6008 to your local machine via `ssh <user-name>@<remote-vm-ip-address> -L 6008:localhost:6008` if you're running this notebook in a remote VW. On the Tensorboard, you will see a dashboard similar to the following one:\n",
"\n",
"<img src=\"https://user-images.githubusercontent.com/20047467/75494844-24be5100-598b-11ea-97ea-96b32373e75d.png\" width=\"720\" height=\"800\">"
]
@ -766,51 +781,18 @@
"metadata": {},
"outputs": [],
"source": [
"# Specify path of the TensorBoard binary\n",
"os.environ[\"TENSORBOARD_BINARY\"] = module_path(\"forecasting_env\", \"tensorboard\")"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Reusing TensorBoard on port 6008 (pid 117617), started 0:31:49 ago. (Use '!kill 117617' to kill it.)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
" <iframe id=\"tensorboard-frame-dcf4bb99f4bea973\" width=\"100%\" height=\"800\" frameborder=\"0\">\n",
" </iframe>\n",
" <script>\n",
" (function() {\n",
" const frame = document.getElementById(\"tensorboard-frame-dcf4bb99f4bea973\");\n",
" const url = new URL(\"/\", window.location);\n",
" url.port = 6008;\n",
" frame.src = url;\n",
" })();\n",
" </script>\n",
" "
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Display TensorBoard\n",
"%tensorboard --logdir logs/scalars --port 6008"
"CHECK_TENSORBOARD = False\n",
"tensorboard_path = \"\" # Replace this with the path you find from terminal\n",
"if CHECK_TENSORBOARD:\n",
" if not tensorboard_path:\n",
" # Try to find path of the TensorBoard binary\n",
" tensorboard_path = module_path(\"forecasting_env\", \"tensorboard\")\n",
" if tensorboard_path:\n",
" os.environ[\"TENSORBOARD_BINARY\"] = tensorboard_path\n",
" # Display TensorBoard\n",
" %tensorboard --logdir logs/scalars --port 6008\n",
" else:\n",
" print(\"Can't find TensorBoard binary. TensorBoard visualization is skipped.\")"
]
},
{
@ -824,7 +806,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 11,
"metadata": {},
"outputs": [
{
@ -880,7 +862,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 12,
"metadata": {},
"outputs": [
{

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -59,7 +59,10 @@ def module_path(env_name, module_name):
command = "which " + module_name
all_paths = subprocess.check_output(command, shell=True)
all_paths = all_paths.decode("utf-8").split("\n")
module_path = [path for path in all_paths if env_name in path][0]
all_paths = [path for path in all_paths if env_name in path]
module_path = ""
if all_paths:
module_path = all_paths[0]
if system == "win":
# Remove additional char \r
module_path = module_path[:-1]