Skip to content

Commit fd890e9

Browse files
committed
Upgrading to Swift 4.0 / TensorFlow 1.4.0 / Docker
1 parent 0a1b7f8 commit fd890e9

File tree

5 files changed

+18
-36
lines changed

5 files changed

+18
-36
lines changed

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
.DS_Store
2-
/.build
3-
/.build_lin
2+
/.build*
43
/Packages
54
/*.xcodeproj
65
*.pins
76
*.pb
7+
/*.resolved
8+
/*.pins
9+
/*.orig
10+
/*_deploy
11+
/.package*

PADockerfile_build

Lines changed: 0 additions & 10 deletions
This file was deleted.

Package.swift

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,17 @@
1-
//
2-
// Package.swift
3-
// Perfect-TensorFlow-Demo-Computer Vision
4-
//
5-
// Created by Rockford Wei on 2017-06-19.
6-
// Copyright © 2017 PerfectlySoft. All rights reserved.
7-
//
8-
//===----------------------------------------------------------------------===//
9-
//
10-
// This source file is part of the Perfect.org open source project
11-
//
12-
// Copyright (c) 2017 - 2018 PerfectlySoft Inc. and the Perfect project authors
13-
// Licensed under Apache License v2.0
14-
//
15-
// See http://perfect.org/licensing.html for license information
16-
//
17-
//===----------------------------------------------------------------------===//
18-
//
19-
1+
// swift-tools-version:4.0
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
203

214
import PackageDescription
225

236
let package = Package(
247
name: "PerfectTensorFlowDemo",
258
dependencies: [
26-
.Package(url: "https://github.com/PerfectlySoft/Perfect-HTTPServer.git", majorVersion: 2),
27-
.Package(url: "https://github.com/PerfectlySoft/Perfect-TensorFlow.git", majorVersion: 1)
9+
.package(url: "https://github.com/PerfectlySoft/Perfect-HTTPServer.git", from: "3.0.0"),
10+
.package(url: "https://github.com/PerfectlySoft/Perfect-TensorFlow.git", from: "1.4.0"),
11+
],
12+
targets: [
13+
.target(
14+
name: "PerfectTensorFlowDemo",
15+
dependencies: ["PerfectHTTPServer", "PerfectTensorFlow"]),
2816
]
2917
)

Sources/main.swift renamed to Sources/PerfectTensorFlowDemo/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ do {
164164
fModel.close()
165165
try fTag.open(.read)
166166
let lines = try fTag.readString()
167-
tags = lines.utf8.split(separator: 10).map { String(describing: $0) }
167+
tags = lines.split(separator: "\n").map { String(describing: $0) }
168168
try TF.Open()
169169
inceptionModel = try LabelImage( Data(bytes: modelBytes) )
170170
print("library ready")

install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
OSABR=$(echo $(uname)|tr '[:upper:]' '[:lower:]')
2-
VERSION=1.3.0
2+
VERSION=1.4.0
33
DWN=/tmp/libtensorflow.tgz
44
URL=https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-$OSABR-x86_64-$VERSION.tar.gz
55
echo $URL
66
wget $URL -O $DWN
7-
sudo tar xvf $DWN -C /usr/local ./lib/libtensorflow.so
7+
tar xvf $DWN -C /usr/local ./lib/libtensorflow.so ./lib/libtensorflow_framework.so
88
rm -f $DWN
99
echo 'download AI model'
1010
wget https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip -O /tmp/in.zip

0 commit comments

Comments
 (0)