Skip to content

Commit

Permalink
Upgrading to Swift 4.0 / TensorFlow 1.4.0 / Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
RockfordWei committed Nov 22, 2017
1 parent 0a1b7f8 commit fd890e9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 36 deletions.
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
.DS_Store
/.build
/.build_lin
/.build*
/Packages
/*.xcodeproj
*.pins
*.pb
/*.resolved
/*.pins
/*.orig
/*_deploy
/.package*
10 changes: 0 additions & 10 deletions PADockerfile_build

This file was deleted.

30 changes: 9 additions & 21 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
//
// Package.swift
// Perfect-TensorFlow-Demo-Computer Vision
//
// Created by Rockford Wei on 2017-06-19.
// Copyright © 2017 PerfectlySoft. All rights reserved.
//
//===----------------------------------------------------------------------===//
//
// This source file is part of the Perfect.org open source project
//
// Copyright (c) 2017 - 2018 PerfectlySoft Inc. and the Perfect project authors
// Licensed under Apache License v2.0
//
// See http://perfect.org/licensing.html for license information
//
//===----------------------------------------------------------------------===//
//

// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "PerfectTensorFlowDemo",
dependencies: [
.Package(url: "https://github.com/PerfectlySoft/Perfect-HTTPServer.git", majorVersion: 2),
.Package(url: "https://github.com/PerfectlySoft/Perfect-TensorFlow.git", majorVersion: 1)
.package(url: "https://github.com/PerfectlySoft/Perfect-HTTPServer.git", from: "3.0.0"),
.package(url: "https://github.com/PerfectlySoft/Perfect-TensorFlow.git", from: "1.4.0"),
],
targets: [
.target(
name: "PerfectTensorFlowDemo",
dependencies: ["PerfectHTTPServer", "PerfectTensorFlow"]),
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ do {
fModel.close()
try fTag.open(.read)
let lines = try fTag.readString()
tags = lines.utf8.split(separator: 10).map { String(describing: $0) }
tags = lines.split(separator: "\n").map { String(describing: $0) }
try TF.Open()
inceptionModel = try LabelImage( Data(bytes: modelBytes) )
print("library ready")
Expand Down
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
OSABR=$(echo $(uname)|tr '[:upper:]' '[:lower:]')
VERSION=1.3.0
VERSION=1.4.0
DWN=/tmp/libtensorflow.tgz
URL=https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-$OSABR-x86_64-$VERSION.tar.gz
echo $URL
wget $URL -O $DWN
sudo tar xvf $DWN -C /usr/local ./lib/libtensorflow.so
tar xvf $DWN -C /usr/local ./lib/libtensorflow.so ./lib/libtensorflow_framework.so
rm -f $DWN
echo 'download AI model'
wget https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip -O /tmp/in.zip
Expand Down

0 comments on commit fd890e9

Please sign in to comment.