-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathhack.py
More file actions
19 lines (14 loc) · 744 Bytes
/
hack.py
File metadata and controls
19 lines (14 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import os
import ssl
def hack():
# --------------------------------------------------------------------
# disable the error:
# `Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA`
# --------------------------------------------------------------------
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
# --------------------------------------------------------------------
# hack to avoid SSL download error
# --------------------------------------------------------------------
if (not os.environ.get('PYTHONHTTPSVERIFY', '') and
getattr(ssl, '_create_unverified_context', None)):
ssl._create_default_https_context = ssl._create_unverified_context