Tensorflow-Federated - OSError: [Errno 8] Exec Format Error: /python3.10/site-packages/tensorflow_federated/../../..data/worker_binary - machine-learning

Being fairly new to Federated Learning, after following the instructions on Setting up FL, I faced this one error repeatedly when testing if Tensorflow-Federated is indeed installed, as shown below
I have installed all relevant dependencies and there were not any warning messages or error messages
Requirements already satisfied: pip in ./venv/lib/python3.10/site-packages
Expected Output when executing:
print(tff.federated_computation(lambda: 'Hello World')())
Should be
b'Hello, World!'
Received Output:
OSError: [Errno 8] Exec format error: '/venv/lib/python3.10/site-packages/tensorflow_federated/python/core/backends/native/../../../../data/worker_binary'
These are the environment details(if it matters):
macOS Ventura 13.1
python 3.10 on vsCode
tensorflow 2.11.0
Are there any ways in which I can work around this? Note: I have tried resetting the environment multiple times and clearing the runtime on the notebook file(.ipynb) as well

Related

Issues with running remix Binary in Bazel sandbox

I've encountered an issue trying to use bazel as a build tool for remix. I've been able to run remix in dev mode but currently unable to get remix build to work.
I've encountered a few errors that led up to this point. I'll list the errors in the order which they occurred with my fixes (just incase any of the fixes introduces a new issue)
First error in the bazel sandbox is related to a transitive dependency of #remix-run/dev (#remix-run/dev->gunzip-maybe->browserify-zlib). Bazel failed to fetch the bazel repository #npm__browserify-zlib__0.1.4. I assumed this was a bazel issue and tried to override browserify-zlib#0.1.4 with browserify-zlib#0.2.0, which worked. Here is bazel error for reference:
ERROR: /Users/emmanuel/projects/bbbazel/WORKSPACE:89:17: fetching _npm_import rule //external:npm__browserify-zlib__0.1.4: Traceback (most recent call last):
File "/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/external/aspect_rules_js/npm/private/npm_import.bzl", line 471, column 27, in _impl
pkg_json = json.decode(rctx.read(pkg_json_path))
Error in decode: at offset 685, object has duplicate key: "main"
ERROR: /private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/external/npm/BUILD.bazel:3012:6: #npm//:npm__browserify-zlib__0.1.4_source_directory depends on #npm__browserify-zlib__0.1.4//:source_directory in repository #npm__browserify-zlib__0.1.4 which failed to fetch. no such package '#npm__browserify-zlib__0.1.4//': at offset 685, object has duplicate key: "main"
Next error in the bazel sandbox is related to another transitive dependency of #remix-run/dev (#remix-run/dev->xdm->deasync). The install lifecycle hook for the deasync npm package makes a call to the node-gyp binary which doesn't exist in the sandbox and the bazel build command fails during setup. To fix this, I disabled the install lifecycle hook (I also disabled it with a pnpm install outside the sandbox and the remix build command executed perfectly) which led to the final error. Here's the error message for this error:
/Users/emmanuel/projects/bbbazel/BUILD.bazel:5:22: Running lifecycle hooks on npm package deasync#0.1.28 failed: (Exit 1): lifecycle-hooks.sh failed: error executing command (from target //:.aspect_rules_js/node_modules/deasync#0.1.28/lc) bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/aspect_rules_js/npm/private/lifecycle/lifecycle-hooks.sh deasync ../../../external/npm__deasync__0.1.28/package ... (remaining 1 argument skipped)
/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/external/aspect_rules_js/npm/private/lifecycle/min/node-gyp-bin/node-gyp: line 5: 1211: command not found
node-gyp not found! Please upgrade your install of npm! You need at least 1.1.5 (I think) and preferably 1.1.30.
> deasync#0.1.28 install /private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/deasync#0.1.28/node_modules/deasync
> node ./build.js
===============================================================
Failure while running lifecycle hook for package 'deasync#0.1.28':
Script: 'install'
Command: `node ./build.js`
Stack trace:
spawn ENOENT
at ChildProcess.<anonymous> (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/external/aspect_rules_js/npm/private/lifecycle/min/index.min.js:1:91930)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1100:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
The final error suggests a bug with remix, but since it only occurs in the bazel sandbox I think it may be an issue that cuts across bazel and remix. The error returned is shown below:
The following error is a bug in Remix; please open an issue! https://github.com/remix-run/remix/issues/new
Missing output for entry point
Error
at Object.onCompileFailure (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/cli/commands.js:180:13)
at Object.compile (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/compiler/remixCompiler.js:34:134)
at async Object.build (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/compiler/build.js:33:3)
at async Object.build (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/cli/commands.js:175:3)
at async Object.run (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/cli/run.js:449:7)
Building Remix app in production mode...
Target //examples/remix:build failed to build
I've tried to run it outside bazel and with pnpm (I added the override to the package.json for browserify-zlip#0.2.0, then I ran pnpm instal with --ignore-scripts flag) and it builds fine.
I'm not sure if this is a bug with remix or a bazel issue. Has anyone else experienced this? Or does anyone having a working version of remix with bazel as the build tool?
I've created a minified version of the repository in the state of the 3rd error https://github.com/noelenwenede/bbbazel. Start up instructions are in the readme file.

Permission denied with building angular-bazel-example with Bazel 0.21 on Windows

I am consistently seeing an error when I try to execute bazel run //src:devserver in the angular-bazel-example project.
I am using Windows 10. I haven't been able to find anything that fixes this. I thought the issue might be related to patch or to the path being too long. However, I've used MSYS2 to install patch, I've changed the output directory using the option --output_user_root, and I've tried using a DOS prompt with admin privileges. Nothing seems to help.
The error message
INFO: SHA256 (https://codeload.github.com/golang/tools/zip/3e7aa9e59977626dc60433e9aeadf1bb63d28295) = 2384fa91351a7414b643c5230422ce45f5aa2be8a82727609afd4e64e6973a30
ERROR: Analysis of target '//src:devserver' failed; build aborted: no such package '#org_golang_x_tools//go/gcexportdata': Traceback (most recent call last):
File "C:/temp/vvsv3266/external/bazel_tools/tools/build_defs/repo/http.bzl", line 55
patch(ctx)
File "C:/temp/vvsv3266/external/bazel_tools/tools/build_defs/repo/utils.bzl", line 82, in patch
fail(("Error applying patch %s:\n%s%s...)))
Error applying patch #io_bazel_rules_go//third_party:org_golang_x_tools-gazelle.patch:
java.io.IOException: ERROR: src/main/native/windows/processes-jni.cc(383): CreateProcessW("C:\msys64\usr\bin" -c "patch '-p1' < C:/temp/vvsv3266/external/io_bazel_rules_go/third_party/org_golang_x_tools-gazelle.patch"): Access is denied.
INFO: Elapsed time: 691.367s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (484 packages loaded, 20777 targets configured)
FAILED: Build did NOT complete successfully (484 packages loaded, 20777 targets configured)
Fetching #ngdeps; fetching 245s
Fetching #org_golang_x_tools; Patching repository 15s
Can someone please tell me how to remedy this?

Openlayers Custom build tutorial is crashing

I am working through the openlayers custom build tutorial and I am getting the following error
info ol Parsing dependencies
info ol Compiling 345 sources
events.js:141
throw er; // Unhandled 'error' event
^
Error: spawn java ENOENT
at exports._errnoException (util.js:870:11)
at Process.ChildProcess._handle.onexit
(internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at nextTickCallbackWith2Args (node.js:441:9)
at process._tickCallback (node.js:355:17)
Exit 1
when I run:
node tasks/build.js build/ol-custom.json build/ol-custom.js
Googling the error gives a solution where it could be another node instance running in the background (there isnt)
also the tutorial says closure-util should be in:
node_modules/openlayers/node_modules
but it is actually in:
node_modules/closure-util
Any idea why this is happening?
It turns out java wasn't set up properly on my path and so it couldn't build. Remember to check your environment with java -version.
On Ubuntu you can install install java 11 (working with this version):
sudo apt install openjdk-11-jre-headless
It should return:
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1)
OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1, mixed mode, sharing)
Then you can run again:
node tasks/build.js build/ol-custom.json build/ol-custom.js

Macports issue setting up RVM

Just setting up rails and RVM on a new laptop and i'm getting this error when running
Error running 'requirements_osx_port_update_system ruby-2.0.0-p247',
please read /Users/#####/.rvm/log/1380821805_ruby-2.0.0-p247/update_system.log
Requirements installation failed with status: 1.
When running this
sudo rvm install ruby
Which produces this code.
[2013-10-03 13:36:45] requirements_osx_port_update_system
requirements_osx_port_update_system ()
{
__rvm_try_sudo port -dv selfupdate || return $?
}
current path: /Users/matthewpetitt
command(2): requirements_osx_port_update_system ruby-2.0.0-p247
DEBUG: Copying /Users/matthewpetitt/Library/Preferences/com.apple.dt.Xcode.plist to /opt/local/var/macports/home/Library/Preferences
DEBUG: MacPorts sources location: /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
---> Updating MacPorts base sources using rsync
rsync: failed to connect to rsync.macports.org: Operation timed out (60)
rsync error: error in socket IO (code 10) at /SourceCache/rsync/rsync- 42/rsync/clientserver.c(105) [receiver=2.6.9]
Command failed: /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/tarballs/base.tar /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
Exit code: 10
DEBUG: Error synchronizing MacPorts sources: command execution failed
while executing
"macports::selfupdate [array get global_options] base_updated"
Error: Error synchronizing MacPorts sources: command execution failed
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: /Users/matthewpetitt/.rvm/bin/port: port selfupdate failed: Error synchronizing MacPorts sources: command execution failed
I already have Xcode and Xcode command line tools installed. Anyone fixed something like this before.
Realized that it was just some network configuration at work that must have been blocking the ports. Check your network permissions or try a different network.
You need to make sure this command can be run first:
sudo port -dv selfupdate
This can be temporary network problem - if it is not follow the displayed instructions.

Trigger.io error "/usr/bin/codesign no identity found" can't create package or run the app on the device

I have a problem when trying to run my application on the device or create IPA file.
I followed the steps here and I have this error when trying to run on iOS option:
[ERROR] Failed when running /usr/bin/codesign: FdawaDev: no identity found
I tried to make it throw terminal with this command
forge package ios --ios.profile.provisioning_profile Development.mobileprovision
and I'm getting this error
/Applications/TriggerToolkit.app/Contents/MacOS/forge -v package ios --ios.profile.provisioning_profile Development.mobileprovision
[ INFO] Forge tools running at version 3.3.43
[ DEBUG] Checking for update zip...
[ ERROR] Couldn't import generation code: No module named generate_dynamic
[ DEBUG] Traceback (most recent call last):
File "/Applications/TriggerToolkit.app/Contents/MacOS/build-tools/forge/async.py", line 98, in run
result = self._target(*self._args, **self._kwargs)
File "/Applications/TriggerToolkit.app/Contents/MacOS/build-tools/forge/main.py", line 443, in package
generate_dynamic = forge_build.import_generate_dynamic()
File "/Applications/TriggerToolkit.app/Contents/MacOS/build-tools/forge/build.py", line 67, in import_generate_dynamic
raise ForgeError("Couldn't import generation code: {0}".format(e))
ForgeError: Couldn't import generation code: No module named generate_dynamic
I removed TriggerToolkit and download the latest one, installed it again and I'm still getting the same error.
What am I missing?
The first error is a configuration problem: you're pointing at an iOS developer identity called "FdawaDev" when one doesn't exist in your Keychain.
Unless you have several identities, you can safely leave the "Certificate" Local Config setting empty in the Toolkit.
If you have several identities, you should specify one with something like iPhone Developer: James Brady.
For the second problem, when using the command line tools, you have to manually run a build before doing a run or package action, e.g.:
% forge build ios && forge package ios

Resources