LoginSignup
0
0

More than 5 years have passed since last update.

クラウドサーバでTensorFlow その6

Posted at

概要

クラウドサーバでTensorFlowやってみた。
cgi-binでpython3やってみた。
jsonのクロスドメイン対策してみた。

環境

クラウド idcf
linux debian-8.11
tensorflow 1.2
gpu 無し

サンプルコード

#!/usr/bin/python3
import sys
import os
import cgi
import json
import cgitb
cgitb.enable()

print ('Content-Type: text/json; charset=utf-8')
print ('Cache-Control: no-cache')
print ('Access-Control-Allow-Origin: *')
print ('Access-Control-Allow-Headers: *')
print ('Access-Control-Allow-Methods: GET, HEAD, POST, TRACE, OPTIONS')
res = json.dumps({
    'status': True,
    'num': 5
})
print ("Content-Length: ", len(res))
print ("Connection: close")
print ()
print (res)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0