Tutorials/CNTK_208_Speech_Connectionist_Temporal_Classification.ipynb: fix Py 2 compatibility

This commit is contained in:
Mark Hillebrand 2017-07-31 09:05:03 +02:00
Родитель d817f8bda1
Коммит bb2700ebfe
1 изменённых файлов: 2 добавлений и 2 удалений

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

@ -43,11 +43,11 @@
"data_dir = os.path.join(\"..\", \"Tests\", \"EndToEndTests\", \"Speech\", \"Data\")\n", "data_dir = os.path.join(\"..\", \"Tests\", \"EndToEndTests\", \"Speech\", \"Data\")\n",
"print(\"Current directory {0}\".format(os.getcwd()))\n", "print(\"Current directory {0}\".format(os.getcwd()))\n",
"\n", "\n",
"try:\n", "if os.path.exists(data_dir):\n",
" if os.path.realpath(data_dir) != os.path.realpath(os.getcwd()):\n", " if os.path.realpath(data_dir) != os.path.realpath(os.getcwd()):\n",
" os.chdir(data_dir)\n", " os.chdir(data_dir)\n",
" print(\"Changed to data directory {0}\".format(data_dir))\n", " print(\"Changed to data directory {0}\".format(data_dir))\n",
"except FileNotFoundError:\n", "else:\n",
" print(\"Data directory not available locally. Downloading data.\")\n", " print(\"Data directory not available locally. Downloading data.\")\n",
" try:\n", " try:\n",
" from urllib.request import urlretrieve\n", " from urllib.request import urlretrieve\n",