faas-and-furious / inception-function Goto Github PK
View Code? Open in Web Editor NEWTensorFlow ImageNet/Inception as an OpenFaaS function
Home Page: https://www.openfaas.com
TensorFlow ImageNet/Inception as an OpenFaaS function
Home Page: https://www.openfaas.com
The project readme reads:
faas-cli invoke --name inception
For faas-cli version 0.5.0 should be
faas-cli invoke inception
or
faas-cli invoke --gateway http://192.168.99.100:31112 inception
(faas-cli --help does not document --gateway as a flag)
I have been unable to use the function (with gateway timeout of 60s), however I have only tested locally with minikube.
echo http://scottleedavis.com/assets/img/scott.jpeg | faas-cli invoke inception
returns json classfication
$ echo http://scottleedavis.com/assets/img/scott.jpeg | faas-cli invoke inception
Server returned unexpected status code: 502 -
$ echo http://scottleedavis.com/assets/img/twitter.png | faas-cli invoke inception
Server returned unexpected status code: 404 - error finding function inception.openfaas-fn: server returned non-200 status code (500) for function, inception
Since the second call produces a 404 I am less inclined to simply increase the timeout.
I am experimenting with building an image analysis/classification pipeline based on cozyish, written purely in openfaas, called gezellig
faas-cli version
): ___ _____ ____
/ _ \ _ __ ___ _ __ | ___|_ _ __ _/ ___|
| | | | '_ \ / _ \ '_ \| |_ / _` |/ _` \___ \
| |_| | |_) | __/ | | | _| (_| | (_| |___) |
\___/| .__/ \___|_| |_|_| \__,_|\__,_|____/
|_|
CLI:
commit: b7a67fe8d6a02aef35caae615ba56333e7337bfe
version: 0.9.5
Gateway
uri: http://192.168.99.104:31112
version: 0.18.0
sha: 137b63e61fe55e0aea7df466931198c37817f743
commit: Add namespaces endpoint
Provider
name: faas-netes
orchestration: kubernetes
version: 0.9.4
sha: 7eb226a33d819983c9d27911365d8708e59ebf80
docker version
(e.g. Docker 18.06 ):$ docker version
Client: Docker Engine - Community
Version: 19.03.4
API version: 1.40
Go version: go1.12.10
Git commit: 9013bf5
Built: Thu Oct 17 23:44:48 2019
OS/Arch: darwin/amd64
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 19.03.4
API version: 1.40 (minimum version 1.12)
Go version: go1.12.10
Git commit: 9013bf5
Built: Thu Oct 17 23:50:38 2019
OS/Arch: linux/amd64
Experimental: true
containerd:
Version: v1.2.10
GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339
runc:
Version: 1.0.0-rc8+dev
GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
docker-init:
Version: 0.18.0
GitCommit: fec3683
Are you using Docker Swarm or Kubernetes (FaaS-netes)?
kubernetes, currently minikube for evaluation
Operating System and version (e.g. Linux, Windows, MacOS):
OSX 10.14.6
How much RAM is available on your nodes?
16g on machine, standard setup for minikube
Are you running on x86_64 or ARM?
x86
Link to your project or a code example to reproduce issue:
https://github.com/servernull/gezellig/blob/master/run.sh#L14
Please also follow the troubleshooting guide and paste in any other diagnostic information you have:
The troubleshooting link doesn't work for me.
I got two questions:
signal: illegal instruction (core dumped)
So decided to get this working on my new MacBook Pro as can't get it to work on the server
URL=https://upload.wikimedia.org/wikipedia/commons/6/61/Humpback_Whale_underwater_shot.jpg \ echo $URL | faas-cli invoke inception
[{"name": "great white shark", "score": 0.5343291759490967}, {"name": "tiger shark", "score": 0.09276486188173294}, {"name": "grey whale", "score": 0.05899052694439888}, {"name": "sea lion", "score": 0.05105864629149437}, {"name": "hammerhead", "score": 0.019910583272576332}, {"name": "sturgeon", "score": 0.013177040033042431}, {"name": "stingray", "score": 0.00763126602396369}, {"name": "electric ray", "score": 0.006749240681529045}, {"name": "killer whale", "score": 0.005086909048259258}, {"name": "ice bear", "score": 0.003828041721135378}]
URL=https://upload.wikimedia.org/wikipedia/commons/6/61/Humpback_Whale_underwater_shot.jpg
echo $URL | faas-cli invoke inception
Server returned unexpected status code: 500 - exit status 1
Traceback (most recent call last):
File "index.py", line 16, in
print(inception.invoke(st))
File "/root/inception.py", line 570, in invoke
image_path = download.maybe_download(body, data_dir)
File "/root/download.py", line 70, in maybe_download
download_local(url, file_path, agent)
File "/root/download.py", line 79, in download_local
r = requests.get(url, headers=headers)
File "/usr/local/lib/python3.5/dist-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 519, in request
prep = self.prepare_request(req)
File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 462, in prepare_request
hooks=merge_hooks(request.hooks, self.hooks),
File "/usr/local/lib/python3.5/dist-packages/requests/models.py", line 313, in prepare
self.prepare_url(url, params)
File "/usr/local/lib/python3.5/dist-packages/requests/models.py", line 387, in prepare_url
raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL '': No schema supplied. Perhaps you meant http://?
Installed OpenFaas on local machine
Installed Inception via store
Ran Inception
Docker 18.09.1, OSX 10.14.2 i7 2.5ghz
CLI:
commit: a141dedf94ffeed84412365fd591bdc8999c5a1b
version: 0.8.3
Gateway
uri: http://127.0.0.1:8080
version: 0.11.1
sha: c394b09ae65177b3c6948b2c22b890068a8e6283
commit: Bump to nats-queue-worker 0.7.0
Provider
name: faas-swarm
orchestration: swarm
version: 0.6.1
sha: 3cac0ccc2e8bb7f567739a33f7d414cdb58440aa
Running the example code should return [{"name": "great white shark", "score": 0.5343291759490967}, {"name": "tiger shark", "score": 0.09276486188173294}, {"name": "grey whale", "score": 0.05899052694439888}, {"name": "sea lion", "score": 0.05105864629149437}, {"name": "hammerhead", "score": 0.019910583272576332}, {"name": "sturgeon", "score": 0.013177040033042431}, {"name": "stingray", "score": 0.00763126602396369}, {"name": "electric ray", "score": 0.006749240681529045}, {"name": "killer whale", "score": 0.005086909048259258}, {"name": "ice bear", "score": 0.003828041721135378}]
URL=https://upload.wikimedia.org/wikipedia/commons/6/61/Humpback_Whale_underwater_shot.jpg echo $URL | faas-cli invoke inception
Server returned unexpected status code: 500 - signal: illegal instruction (core dumped)
I installed the function via the function store
Dual Intel(R) Xeon(R) CPU L5410 @ 2.33GHz
128GB DDR2
docker version
(e.g. Docker 18.06 ):Server: Docker Engine - Community
Engine:
Version: 18.09.1
API version: 1.39 (minimum version 1.12)
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:02:44 2019
OS/Arch: linux/amd64
Experimental: false
Are you using Docker Swarm or Kubernetes (FaaS-netes)?
Swarm
Operating System and version (e.g. Linux, Windows, MacOS):
Ubuntu 16.04
How much RAM is available on your nodes?
422d6498a3fb inception.1.4knd787uo9z1r0wdt8s5ptsa8 0.00% 1.258MiB / 123.5GiB 0.00% 15.1kB / 6.32kB 56.9MB / 0B 7
Are you running on x86_64 or ARM?
x86_64
Link to your project or a code example to reproduce issue:
Its the code here
Please also follow the [troubleshooting guide]
We are trying to run inception function on Intel based devices on
OpenFaaS (one master, one slave). We are have not been able to scale
it out. Wondering if this is general problem with OpenFaaS or just a problem with this function.
Expecting that if inception is called multiple times that OpenFaaS would start scaling it out.
Apparently the alert manager scales only when it detects many (short?) function invocations per second. However, in this case, the inception function executes for several seconds and, hence, alert manager fails to scale out.
Just following inception function instructions and invoking it several times.
FaaS-CLI version ( Full output from: faas-cli version
): 0.8.8
Docker version docker version
): 18.06
Are you using Docker Swarm or Kubernetes (FaaS-netes)? Kubernetes
Operating System and version (e.g. Linux, Windows, MacOS): Ubuntu 16.04.6 LTS
How much RAM is available on your nodes? 32 BB
Are you running on x86_64 or ARM? x86_64
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.