Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

In Release mode any module outputs always same #72

@darkThanBlack

Description

@darkThanBlack

🐛 Bug

In PyTorch iOS HelloWorld proj, if you just change Build Configuration to Release,the module output always same value.

To Reproduce

Steps to reproduce the behavior:

  1. Download PyTorch HelloWord proj from https://github.com/pytorch/ios-demo-app/tree/master/HelloWorld.
  2. Insert different image and model to proj.
  3. Create different pixelBuffer from inserted image, print result for module.predict(image: UnsafeMutableRawPointer(&pixelBuffer)) func, we can find outputs value is different.
  4. In Xcode IDE, select Edit Scheme... -> Run -> Info -> Build Configuration from Debug to Release.
  5. just print return value for module.predict(image: UnsafeMutableRawPointer(&pixelBuffer)) again, we can find all outputs value is same.
  6. I also uploaded my test proj, just simply changed sth. from HelloWord, you can find it here: https://github.com/darkThanBlack/MOONPyTorchIssue, you may need change Signing Certificate or other configs to run it.

Other Info

  1. You can find my sample code in ViewController.m, Line 24 to Line 67...
  2. I tried change .pt and predict implement(I have another private proj to do some face recognize and it works well in Debug mode, I can't upload it because relate some user info), no matter what things I input, outputs seemd a static value.
  3. I also tried change all proj Build Settings config releated to Debug/Release but can't fix it.
  4. I also tried build PyTorch Libraries from source but still can't fix it , I tried read PyTorch source code but not sure how Xcode proj's Debug/Release affect .a libraries...
  5. Here is some hint image for help...
    hint02

hint03

Environment

  • Setup PyTorch with pod 'LibTorch-Lite', '~> 1.9.0' or build from source.
  • OS : Apple M1, iPhone 12(iOS 14.8);Other Mac/iOS OS is reproducible too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions