Code Monkey home page Code Monkey logo

caffe2-ios's People

Contributors

abjurato avatar danielhauagge avatar robertbiehl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

caffe2-ios's Issues

why the performance on my iphone6 is quite different with you. It costs 35ms actually?

ℹ Please fill out this template when filing an issue.
All lines beginning with an ℹ symbol instruct you with
what info we expect.
Please remove this line and all above before submitting.

Report

What did you do?

ℹ Please replace this with what you did.

What did you expect to happen?

ℹ Please replace this with what you expected to happen.

What happened instead?

ℹ Please replace this with of what happened instead.

Project that demonstrates the issue

ℹ Please link to a project we can download that reproduces the issue.
You can delete this section if your issue is unrelated to build problems,

eigen mode to nnpack mode

From the profiling tool of xcode ,i found that no nnpack function has been used. And the eigen function has been used. So how can i change the compute mode from eigen to nnpack?

How can I use other models instead of squeeze_net?

Hi RobertBiehl,
I want to use other models instead of squeeze_net,I clone(git clone) the models from https://github.com/caffe2/models.I use bvlc_googlenet model,and the image is 224*224.But it is Incorrect.
My code below:
do{
// caffe = try Caffe2(initNetNamed: "squeeze_init_net", predictNetNamed:"squeeze_predict_net")
caffe = try Caffe2(initNetNamed: "exec_net", predictNetNamed:"predict_net")
}catch {
...

and my result:

Results:
Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.

Header Search Path does not lead to caffe2 headers

I've tried to install pod as described in repository readme (just adding one string to Podfile), but project fails to get built:
screen shot 2017-04-24 at 10 31 31

In build settings i see Header Search Paths:

"$(PODS_TARGET_SRCROOT)/lib/caffe2/install/include/"
"$(PODS_TARGET_SRCROOT)/lib/caffe2/third_party/eigen/"

which is resolved by Xcode8.3.1 as /lib/caffe2/install/include and /lib/caffe2/third_party/eigen, which I obviously don't have.

Neither project hierarchy Pods/Caffe2Kit/lib/caffe2 do have such subfolders:

screen shot 2017-04-24 at 10 28 31

Are not these .h files supposed to be copied together with .a files?
Or I've missed something?

libstc++.tdb should be libstdc++.tdb?

Report

What did you do?

I tried to update my build phases with: libstc++.tdb

What did you expect to happen?

I expected to find that item in the prompt to add a build phase.

What happened instead?

I could not find that item. I think you meant libstdc++.tdb
Maybe update the README?

libprotobuff error

Report

What did you do?

Added Podfile:
` Uncomment the next line to define a global platform for your project
platform :ios, '10.3'

target 'meh' do
/# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!

/# Pods for meh
pod 'Caffe2Kit', :git => 'git://github.com/RobertBiehl/caffe2-ios'

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end

target 'mehTests' do
inherit! :search_paths
/# Pods for testing
end

target 'mehUITests' do
inherit! :search_paths
/# Pods for testing
end

end
`
installed pod.
changed bitcode to no
added libstdc++
added other linker flags of:
-force_load
"$(PODS_ROOT)/Caffe2Kit/install/lib/libCaffe2_CPU.a"

My view controller is same as yours:
`
class ViewController: UIViewController {

@IBOutlet var textView : UITextView!
@IBOutlet var imageView : UIImageView!

var caffe : Caffe2?

override func viewDidLoad() {
    super.viewDidLoad()
    do{
     try self.caffe = Caffe2(initNetNamed: "squeeze_init_net", predictNetNamed:"squeeze_predict_net")
    }
    catch{
    
    }
    let 🌅 = #imageLiteral(resourceName: "lion.png")
    
    if let res = caffe?.prediction(regarding: 🌅) {
        // find top 5 classes
        let sorted = res
            .map{$0.floatValue}
            .enumerated()
            .sorted(by: {$0.element > $1.element})[0...5]
        
        // generate output
        let text = sorted
            .map{"\($0.offset): \(classes[$0.offset]) \($0.element*100)%"}
            .joined(separator: "\n")
        
        print("Result\n\(text)")
        textView.text = text
        imageView.image = 🌅
    }
}

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    
}

override func viewDidDisappear(_ animated: Bool) {
    super.viewDidDisappear(animated)
    
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

let classes = [ has all classes trust me :D    ]

}
`
I copied all the sources like lion.png etc from your git.

What did you expect to happen?

The project should run. Giving me the output just like in tutorial

What happened instead?

Instead I ended up with
[libprotobuf ERROR /Users/Robert/Documents/Workspace/caffe2-swift/lib/caffe2/third_party/protobuf/src/google/protobuf/descriptor_database.cc:57] File already exists in database: caffe/proto/caffe.proto [libprotobuf FATAL /Users/Robert/Documents/Workspace/caffe2-swift/lib/caffe2/third_party/protobuf/src/google/protobuf/descriptor.cc:1272] CHECK failed: generated_database_->Add(encoded_file_descriptor, size): libc++abi.dylib: terminating with uncaught exception of type google::protobuf::FatalException: CHECK failed: generated_database_->Add(encoded_file_descriptor, size):

Project that demonstrates the issue

libsystem_kernel.dylib__pthread_kill:
0x185709330 <+0>: mov x16, #0x148
0x185709334 <+4>: svc #0x80
-> 0x185709338 <+8>: b.lo 0x185709350 ; <+32>
0x18570933c <+12>: stp x29, x30, [sp, #-0x10]!
0x185709340 <+16>: mov x29, sp
0x185709344 <+20>: bl 0x1856ea098 ; cerror_nocancel
0x185709348 <+24>: mov sp, x29
0x18570934c <+28>: ldp x29, x30, [sp], #0x10
0x185709350 <+32>: ret
`
It happens before the UI even loads.
I have used both simulator and device along with xcode 8 and 9. Although I do realize it is not a problem related to that but still for sanity purposes did that.

ℹ Please link to a project we can download that reproduces the issue.
https://github.com/Quisher/caffe2-ios-exp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.