FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix pyfasttext opencv, tensorflow · HadokenCode/docker-python@92d3aa1 · GitHub

Commit 92d3aa1

Browse files
Chris Crawford
committed
Fix pyfasttext opencv, tensorflow
1 parent e7f7dc5 commit 92d3aa1

2 files changed

Lines changed: 22 additions & 24 deletions

File tree

‎Dockerfile‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@ RUN apt-get install -y python-software-properties zip && \
6363
echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list && \
6464
curl https://bazel.build/bazel-release.pub.gpg | apt-key add - && \
6565
apt-get update && apt-get install -y bazel && apt-get upgrade -y bazel && \
66-
cd /usr/local/src && git clone https://github.com/tensorflow/tensorflow && \
67-
cd tensorflow && echo "\n" | ./configure && \
68-
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package && \
69-
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg && \
70-
pip install /tmp/tensorflow_pkg/tensorflow*.whl
66+
pip install tensorflow
67+
#cd /usr/local/src && git clone https://github.com/tensorflow/tensorflow && \
68+
#cd tensorflow && echo "\n" | ./configure && \
69+
#bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package && \
70+
#bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg && \
71+
#pip install /tmp/tensorflow_pkg/tensorflow*.whl
7172

7273
RUN apt-get install -y libfreetype6-dev && \
7374
apt-get install -y libglib2.0-0 libxext6 libsm6 libxrender1 libfontconfig1 --fix-missing && \
@@ -366,8 +367,9 @@ RUN pip install --upgrade mpld3 && \
366367
pip install lime && \
367368
pip install memory_profiler
368369

369-
# Temp fix for pyfasttext (cysignals 1.7.0 causes build to fail)
370-
RUN pip install --upgrade cysignals==1.6.9 && \
370+
# install cython & cysignals before pyfasttext
371+
RUN pip install --upgrade cython && \
372+
pip install --upgrade cysignals && \
371373
pip install pyfasttext && \
372374
pip install ktext && \
373375
cd /usr/local/src && git clone --depth=1 https://github.com/facebookresearch/fastText.git && cd fastText && pip install . && \

‎test_build.py‎

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,27 @@
5555
import theano
5656
print("Theano ok")
5757

58-
from keras.models import Sequential
59-
from keras.layers.core import Dense, Dropout, Activation, Flatten
60-
from keras.layers.convolutional import Convolution2D, MaxPooling2D
61-
from keras.optimizers import SGD
62-
print("keras ok")
63-
6458
import nltk
6559
from nltk.stem import WordNetLemmatizer
6660
print("nltk ok")
6761

62+
import cv2
63+
img = cv2.imread('plot1.png',0)
64+
print("OpenCV ok")
65+
6866
import tensorflow as tf
67+
print(tf.__version__)
6968
hello = tf.constant('TensorFlow ok')
7069
sess = tf.Session()
7170
print(sess.run(hello))
71+
print("Tensorflow ok")
72+
73+
from keras.models import Sequential
74+
from keras.layers.core import Dense, Dropout, Activation, Flatten
75+
from keras.layers.convolutional import Convolution2D, MaxPooling2D
76+
from keras.optimizers import SGD
77+
print("Keras ok")
7278

73-
import cv2
74-
img = cv2.imread('plot1.png',0)
75-
print("OpenCV ok")
7679

7780
from skimage.io import imread
7881
print("skimage ok")
@@ -110,18 +113,16 @@
110113
from fastai.io import get_data
111114
print("fast.ai ok")
112115

116+
# Test BigQuery
113117
import os
114118
import threading
115119
from http.server import BaseHTTPRequestHandler, HTTPServer
116120
from google.cloud import bigquery
117-
118121
HOSTNAME = "127.0.0.1"
119122
PORT = 8000
120123
URL = "http://%s:%s" % (HOSTNAME, PORT)
121-
122124
fake_bq_called = False
123125
fake_bq_header_found = False
124-
125126
class HTTPHandler(BaseHTTPRequestHandler):
126127
def do_HEAD(s):
127128
s.send_response(200)
@@ -135,18 +136,13 @@ def do_GET(s):
135136

136137
httpd = HTTPServer((HOSTNAME, PORT), HTTPHandler)
137138
threading.Thread(target=httpd.serve_forever).start()
138-
139139
client = bigquery.Client()
140-
141140
try:
142141
for ds in client.list_datasets(): pass
143142
except:
144143
pass
145-
146144
httpd.shutdown()
147-
148145
assert fake_bq_called, "Fake server did not recieve a request from the BQ client."
149146
assert fake_bq_header_found, "X-KAGGLE-PROXY-DATA header was missing from the BQ request."
150-
151147
print("bigquery proxy ok")
152148

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL