Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Xception network #707

Merged
merged 8 commits into from Dec 16, 2020
Merged

Add Xception network #707

merged 8 commits into from Dec 16, 2020

Conversation

diwakar-vsingh
Copy link
Contributor

@diwakar-vsingh diwakar-vsingh commented Nov 28, 2020

I have created the Xception model which is the backbone in the deepLabV3+ model.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Contributor Author

@diwakar-vsingh diwakar-vsingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BradLarson Also could you direct me to resources so that I can learn to run swift build on my side itself.

Models/ImageClassification/Xception.swift Outdated Show resolved Hide resolved
@BradLarson BradLarson changed the base branch from master to main December 1, 2020 16:02
@BradLarson
Copy link
Contributor

@diwakar-vsingh - Sorry for the slow reply. In regards to building this on your own, that depends on which platform you wanted to work from.

If you're on a Mac, it's pretty straightforward to download a precompiled toolchain and follow these instructions to install it within Xcode. You can then open the directory of your local clone of swift-models directly into Xcode and it will be parsed into a project. Select the ImageClassificationModels build target and you'll be able to build this model and the code around it by itself.

For Ubuntu, you can download a precompiled toolchain and follow these instructions to install the appropriate dependencies and to place the Swift toolchain in an accessible location. You can then go to your fork of swift-models and run swift build to build the entire project. This is the closest to what's run during our presubmit tests.

@diwakar-vsingh
Copy link
Contributor Author

@BradLarson Thanks for the help. I have just set up everything locally on my Mac. I followed the instructions given by you above and everything builds fine locally. I have changed the ConvBlock layer name to ConvBlockModule so that it doesn't conflict with the one define in MobileNetV1.swift.

@diwakar-vsingh
Copy link
Contributor Author

I have also added an inference test for the Xception model in inference.swift.

@diwakar-vsingh
Copy link
Contributor Author

diwakar-vsingh commented Dec 15, 2020

If you're on a Mac, it's pretty straightforward to download a precompiled toolchain and follow these instructions to install it within Xcode

One thing I couldn't set up is to use the Swift toolchain with the command-line tool. Whenever I run the command xcrun --toolchain swift, it always throws an error stating "xcrun: error: no utility name specified." Do you know why am I not able to set this step? Am I missing something here? My Xcode version is 12.3.

Copy link
Contributor

@BradLarson BradLarson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the model implementation, and for the quick response to my comments.

Sorry for the delay in review, but I had to fix something on our CI side to get the presubmit to build this correctly. That's now fixed, and it all builds correctly, so this looks good to go.

@BradLarson BradLarson merged commit d279552 into tensorflow:main Dec 16, 2020
@BradLarson
Copy link
Contributor

@diwakar-vsingh - Honestly, when building at the command line I tend to just use swift build or swift run [target] rather than going through xcrun. If you're missing xcrun, you may need to install the supplemental developer tools via xcode-select --install. swift-models is set up as a Swift Package Manager package which doesn't need Xcode to build, so it's often simpler to just use Swift Package Manager directly.

@diwakar-vsingh
Copy link
Contributor Author

Thank you for the model implementation, and for the quick response to my comments.

Sorry for the delay in review, but I had to fix something on our CI side to get the presubmit to build this correctly. That's now fixed, and it all builds correctly, so this looks good to go.

Thanks for merging the branch. I'm looking forward to committing more.

@diwakar-vsingh
Copy link
Contributor Author

Honestly, when building at the command line I tend to just use swift build or swift run [target] rather than going through xcrun.

Whenever I try to build it directly from the command line using swift build, I get the error that it can't import Tensorflow. That's why I was trying to follow the instructions mentioned here.

@BradLarson
Copy link
Contributor

@diwakar-vsingh - If it can't find TensorFlow, odds are that the Swift compiler being found at the command line is the default toolchain within Xcode. Typically, what I do in that case is either set the toolchain that's installed in Xcode to the Swift for TensorFlow toolchain (done by going to the Xcode | Toolchains menu option, then choosing the right one within that menu) and then use export PATH=/Library/Developer/Toolchains/swift-latest/usr/bin:"${PATH}" at the command line to set the path to that, or use an export PATH= statement that points to the explicit path of the Swift for TensorFlow toolchain. Sorry that dealing with our custom toolchain is a little bit of a pain on macOS.

@diwakar-vsingh
Copy link
Contributor Author

@BradLarson Fixed it. My path was not correct. I had to resort to using export PATH= statement that points to the explicit path of the Swift for TensorFlow toolchain. Thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants