Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Swift interpreter error when loading Python library #84

Closed
davidcittadini opened this issue Nov 16, 2018 · 2 comments
Closed

Swift interpreter error when loading Python library #84

davidcittadini opened this issue Nov 16, 2018 · 2 comments

Comments

@davidcittadini
Copy link

I am trying the Swift interpreter with Swift for TensorFlow. I have created a simple test file as follows. with the latest versions of matplotlib and librosa installed:

#!/usr/bin/env swift
import TensorFlow
import Python
let np = Python.import("numpy")
let plt = Python.import("matplotlib.pyplot")
let librosa = Python.import("librosa")

When I run this with Swift I get the error message:

Assertion failed: (PassInf && "Expected all immutable passes to be initialized"), function addImmutablePass, file /Users/buildbot/miniconda3/conda-bld/llvmdev_1530886763012/work/lib/IR/LegacyPassManager.cpp, line 755.
Stack dump:
0.	Program arguments: /Library/Developer/Toolchains/swift-tensorflow-DEVELOPMENT-2018-10-17-a.xctoolchain/usr/bin/swift -frontend -interpret test.swift -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -color-diagnostics -module-name test
0  swift                    0x000000010ad8b028 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift                    0x000000010ad8a2a5 llvm::sys::RunSignalHandlers() + 85
2  swift                    0x000000010ad8b632 SignalHandler(int) + 258
3  libsystem_platform.dylib 0x00007fff7d84db3d _sigtramp + 29
4  libsystem_platform.dylib 0x00007f847c29ea40 _sigtramp + 4272230176
5  libsystem_c.dylib        0x00007fff7d70b1c9 abort + 127
6  libsystem_c.dylib        0x00007fff7d6d3868 basename_r + 0
7  libllvmlite.dylib        0x000000012e026987 llvm::PMTopLevelManager::addImmutablePass(llvm::ImmutablePass*) + 295
8  libllvmlite.dylib        0x000000012e025b7e llvm::PMTopLevelManager::schedulePass(llvm::Pass*) + 590
9  libllvmlite.dylib        0x000000012e025aa5 llvm::PMTopLevelManager::schedulePass(llvm::Pass*) + 373
10 libllvmlite.dylib        0x000000012d6bddf2 llvm::PassManagerBuilder::populateModulePassManager(llvm::legacy::PassManagerBase&) + 434
11 libffi.dylib             0x00007fff7b8baf6c ffi_call_unix64 + 76
12 libffi.dylib             0x00007ffee8b3e540 ffi_call_unix64 + 1831351840
[1]    8920 abort       PATH="/Library/Developer/Toolchains/swift-latest/usr/bin:/usr/bin:$PATH" swif

If I remove the librosa library then the error goes away.

My current versions are:

Swift: version 4.2-dev (LLVM d1ad27a0c9, Clang 528407c5c8, Swift ac63360ffc)
macOS: Version 10.14.2 Beta (18C38b)
Xcode: Version 10.1 (10B61)
Swift for TensorFlow: DEVELOPMENT-2018-10-17
@rxwei
Copy link
Contributor

rxwei commented Feb 12, 2019

I am unable to reproduce it. It may have been fixed by our last merge from Swift upstream. If the issue persists for you, please reopen this issue. Thanks!

@rxwei rxwei closed this as completed Feb 12, 2019
@askari01
Copy link

i am still facing this issue. i would like to reopen this issue.

brettkoonce pushed a commit to brettkoonce/swift that referenced this issue Mar 14, 2019
bobcatfish is transitioning off of this project.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants