Error Building TensorFlow in Julia, - tensorflow

Error: Error building `TensorFlow`:
│ ERROR: LoadError: UndefVarError: is_windows not defined
│ Stacktrace:
│ [1] top-level scope at none:0
│ [2] include at ./boot.jl:317 [inlined]
│ [3] include_relative(::Module, ::String) at ./loading.jl:1038
│ [4] include(::Module, ::String) at ./sysimg.jl:29
│ [5] include(::String) at ./client.jl:388
│ [6] top-level scope at none:0
│ in expression starting at
/home/amery/.julia/packages/TensorFlow/TizFt/deps/build.jl:13
└ # Pkg.Operations
/buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1068
When I build Mocha in Julia,I got is_apple not defined, some one told me this is because I did not install some module, but which module?

UndefVarError: is_windows not defined in practice means that the module has not been updated from Julia 0.6 to Julia 1.0 yet.
As of today I can recommend you to try Julia 0.7 (you will see some deprecation warnings but otherwise it should work) and wait a few weeks before installing Julia 1.0 for use with TensorFlow.jl.
Looking at this thread you can find it should be very soon:
https://github.com/malmaud/TensorFlow.jl/pull/419

This is a sign that the packages haven't updated for v1.0 yet. You either need to help them update their code or wait.

Related

ERROR: Unsatisfiable requirements detected for package Mux [a975b10e]:

I am trying to install the PlotlyJS package, but I get the following error:
julia> Pkg.add("PlotlyJS")
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Mux [a975b10e]:
Mux [a975b10e] log:
├─possible versions are: 0.4.0-1.0.1 or uninstalled
├─restricted by compatibility requirements with HTTP [cd3eb016] to versions: 1.0.0-1.0.1 or uninstalled
│ └─HTTP [cd3eb016] log:
│ ├─possible versions are: 0.6.10-1.6.2 or uninstalled
│ ├─restricted to versions 1 by Genie [c43c736e], leaving only versions 1.0.0-1.6.2
│ │ └─Genie [c43c736e] log:
│ │ ├─possible versions are: 5.13.0 or uninstalled
│ │ └─Genie [c43c736e] is fixed to version 5.13.0
│ └─restricted by compatibility requirements with LoggingExtras [e6f89c97] to versions: [0.6.10-0.9.17, 1.5.4-1.6.2] or uninstalled, leaving only versions: 1.5.4-1.6.2
│ └─LoggingExtras [e6f89c97] log:
│ ├─possible versions are: 0.1.0-1.0.0 or uninstalled
│ └─restricted to versions 1 by Genie [c43c736e], leaving only versions 1.0.0
│ └─Genie [c43c736e] log: see above
└─restricted by compatibility requirements with Blink [ad839575] to versions: 0.7.0-0.7.6 — no versions left
└─Blink [ad839575] log:
├─possible versions are: 0.8.0-0.12.5 or uninstalled
└─restricted by compatibility requirements with Reexport [189a3867] to versions: 0.12.5 or uninstalled, leaving only versions: 0.12.5
└─Reexport [189a3867] log:
├─possible versions are: 0.2.0-1.2.2 or uninstalled
└─restricted to versions 1 by Genie [c43c736e], leaving only versions 1.0.0-1.2.2
└─Genie [c43c736e] log: see above
Stacktrace:
[1] propagate_constraints!(graph::Pkg.Resolve.Graph, sources::Set{Int64}; log_events::Bool)
# Pkg.Resolve /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/Resolve/graphtype.jl:1072
[2] propagate_constraints! (repeats 2 times)
# /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/Resolve/graphtype.jl:1008 [inlined]
[3] simplify_graph!(graph::Pkg.Resolve.Graph, sources::Set{Int64}; clean_graph::Bool)
# Pkg.Resolve /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/Resolve/graphtype.jl:1533
[4] simplify_graph! (repeats 2 times)
# /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/Resolve/graphtype.jl:1532 [inlined]
[5] resolve_versions!(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, julia_version::VersionNumber)
# Pkg.Operations /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/Operations.jl:352
[6] targeted_resolve(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, preserve::Pkg.Types.PreserveLevel, julia_version::VersionNumber)
# Pkg.Operations /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/Operations.jl:1254
[7] tiered_resolve(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, julia_version::VersionNumber)
# Pkg.Operations /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/Operations.jl:1239
[8] _resolve(io::Base.TTY, env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, preserve::Pkg.Types.PreserveLevel, julia_version::VersionNumber)
# Pkg.Operations /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/Operations.jl:1260
[9] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Set{Base.UUID}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform)
# Pkg.Operations /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/Operations.jl:1276
[10] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
# Pkg.API /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/API.jl:275
[11] add(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
# Pkg.API /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/API.jl:156
[12] add(pkgs::Vector{Pkg.Types.PackageSpec})
# Pkg.API /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/API.jl:145
[13] #add#27
# /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/API.jl:144 [inlined]
[14] add
# /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/API.jl:144 [inlined]
[15] #add#26
# /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/API.jl:143 [inlined]
[16] add(pkg::String)
# Pkg.API /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/API.jl:143
[17] top-level scope
# REPL[18]:1
I am using Julia version 1.8.3:
julia> VERSION
v"1.8.3"
I tried using registry rm General like in this question "Unsatisfiable requirements detected for the package" in Julia, but that doesn't work. So I was wondering if anyone knows how to fix this error?
The answer you linked is unfortunately not very helpful for the majority of "unsatisfiable requirements detected" errors - as you can see there, the error is actually that no version of a package are being found, even thought the package has a number of releases. This is indeed indicative of a corrupt local package registry.
Your case however is different: multiple different versions for all packages in the error message are being found, so there clearly isn't an issue with the registry.
Your question is basically a duplicate of the question I answered here:
Julia "Unsatisfiable requirements detected for package" error when installing multiple packages
which is the more common scenario for "unsatisfiable requirements" issues: you actually have unsatisfiable requirements in the sense that you are trying to install a set of packages into an environment which require incompatible versions of shared dependencies.
However, your issue seems to have a slight twist compared to the linked question above, check out what happens when I do what I did in the other answer and install the packages you're trying to install here (PlotlyJS and Genie) into a new environment:
(#v1.8) pkg> activate --temp
Activating new project at `/tmp/jl_4HTNUi`
(jl_ox50Zr) pkg> add PlotlyJS Genie
Updating registry at `~/.julia/registries/General.toml`
Resolving package versions...
(...)
Updating `/tmp/jl_ox50Zr/Project.toml`
⌃ [c43c736e] + Genie v5.2.2
[f0f68f2c] + PlotlyJS v0.18.10
No error, the operation resolved successfully and I now have Genie installed alongside PlotlyJS. Based on the error message above and my answer in the linked question above, I would have expected this to error so what's going on?
The clue is in two things:
Note the little caret before the Genie entry in the Project.toml of the temporary environment above: ⌃ [c43c736e] + Genie v5.2.2 - this tells us that the Genie version installed is not the latest available version (a feature introduced in Julia 1.8); and
Note this additional bit of info in your error message:
│ │ └─Genie [c43c736e] log:
│ │ ├─possible versions are: 5.13.0 or uninstalled
│ │ └─Genie [c43c736e] is fixed to version 5.13.0
So the issue you're facing is not installing PlotlyJS and Genie per se, but rather adding PlotlyJS to an environment in which you specifically require Genie at version 0.5.13`. Let's confirm that that's the issue in a new temp environment:
(#v1.8) pkg> activate --temp
Activating new project at `/tmp/jl_4HTNUi`
(jl_4HTNUi) pkg> add PlotlyJS Genie#5.13
Updating registry at `~/.julia/registries/General.toml`
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Mux [a975b10e]:
Mux [a975b10e] log:
├─possible versions are: 0.4.0-1.0.1 or uninstalled
├─restricted by compatibility requirements with HTTP [cd3eb016] to versions: 1.0.0-1.0.1 or uninstalled
│ └─HTTP [cd3eb016] log:
│ ├─possible versions are: 0.6.10-1.6.2 or uninstalled
│ └─restricted by compatibility requirements with Genie [c43c736e] to versions: 1.0.0-1.6.2
│ └─Genie [c43c736e] log:
│ ├─possible versions are: 0.9.4-5.13.0 or uninstalled
│ └─restricted to versions 5.13 by an explicit requirement, leaving only versions 5.13.0
└─restricted by compatibility requirements with Blink [ad839575] to versions: 0.4.0-0.7.6 — no versions left
└─Blink [ad839575] log:
├─possible versions are: 0.8.0-0.12.5 or uninstalled
Which is a version of the error you're seeing. So indeed you are trying to do something that doesn't work: Genie 0.5.13 isn't compatible with PlotlyJS based on their respective dependencies, so you'll either have to work with an older Genie version, or a different plotting package, or change the compatibility bounds for PlotlyJS's dependencies to make things work (this is non-trivial, if you do so and things work you should consider making a PR upstream to allow everyone to access the updated version).

take the structure of any project

I have seen the project structure on readMe, how can I take this structure of my project, any program? any website. doesn't seems right to me to create by hand?
Yes, there is a very simple way to get it.
Navigate to the root folder of your project and run tree from your terminal. You should get something like this:
project_root
│ README.md
│
└───some_folder
│ │ another_file.txt
│ │ some_code.code
│ │
│ └───some_subfolder
│ │ some_more_code.txt
│ │ another_file.txt
│ │ a_picture.png
│ │ ...
│
└───another_folder
│ more_files.txt
│ more_code.code
...
Now you can copy and paste this tree into your README file, wrapping it in triple backticks - ``` to get the markdown styling.
https://ascii-tree-generator.com/ --> by hand ***
or ***
tree command in powershell --> auto

Error when trying to run npm build on gitlab-ci with terraform

I'm new to terraform but I've been fairly successful so far. I'm trying to get a mithril app to be built and deployed fully with terraform and gitlab to aws s3 and cloudfront. It is failing on this block here:
data "external" "frontend_build" {
program = ["bash", "-c",
<<EOT
(npm ci && npm run build -- --env.PARAM="$(jq -r '.param')") >&2 && echo "{\"dest\": \"dist\"}"
EOT
]
working_dir = "${path.module}/frontend"
query = {
param = "Hi from Terraform!"
}
}
Here is the error message from gitlab:
Error: External Program Lookup Failed
│
│ with data.external.frontend_build,
│ on data.tf line 2, in data "external" "frontend_build":
│ 2: program = ["bash", "-c", <<EOT
│ 3: (npm ci && npm run build -- --env.PARAM="$(jq -r '.param')") >&2 && echo "{\"dest\": \"dist\"}"
│ 4: EOT
│ 5: ]
│
│ The data source received an unexpected error while attempting to find the
│ program.
│
│ The program must be accessible according to the platform where Terraform is
│ running.
│
│ If the expected program should be automatically found on the platform where
│ Terraform is running, ensure that the program is in an expected directory.
│ On Unix-based platforms, these directories are typically searched based on
│ the '$PATH' environment variable. On Windows-based platforms, these
│ directories are typically searched based on the '%PATH%' environment
│ variable.
│
│ If the expected program is relative to the Terraform configuration, it is
│ recommended that the program name includes the interpolated value of
│ 'path.module' before the program name to ensure that it is compatible with
│ varying module usage. For example: "${path.module}/my-program"
│
│ The program must also be executable according to the platform where
│ Terraform is running. On Unix-based platforms, the file on the filesystem
│ must have the executable bit set. On Windows-based platforms, no action is
│ typically necessary.
│
│ Platform: linux
│ Program: bash
│ Error: exec: "bash": executable file not found in $PATH
I got this code from a tutorial so it may be outdated, but I can't find anyone else talking about this particular thing.
EDIT:
Here is my .gitlab-ci.yml
include:
- template: Terraform.latest.gitlab-ci.yml
variables:
TF_STATE_NAME: default
TF_CACHE_KEY: default
TF_ROOT: terraform/

How do I call ExampleValidator to analyze split data sets?

Using:
Tensorflow version: 2.3.1
TFX version: 0.23.1
TFDV version: 0.24.0
TFMA version: 0.24.0
with an interactive context like so:
from tfx.orchestration.experimental.interactive.interactive_context import \
InteractiveContext
context = InteractiveContext(
pipeline_root=os.path.join(os.getcwd(), "pipeline")
)
I created an ExampleGen using:
output = example_gen_pb2.Output(
split_config=example_gen_pb2.SplitConfig(splits=[
example_gen_pb2.SplitConfig.Split(name='train', hash_buckets=7),
example_gen_pb2.SplitConfig.Split(name='test', hash_buckets=2),
example_gen_pb2.SplitConfig.Split(name='eval', hash_buckets=1)
]))
example_gen = CsvExampleGen(input_base=os.path.join(base_dir, data_dir), output_config=output)
context.run(example_gen)
and later in the code, I tried evaluating the data using an ExampleValidator but it seems the ExampleValidator doesn't resolve the proper paths to the split data sets.
Creation of the validator works as expected:
example_validator = ExampleValidator(
statistics=statistics_gen.outputs['statistics'],
schema=schema_gen.outputs['schema'])
context.run(example_validator)
No warning or errors were had, but attempting to show the results, error on the paths not being correct:
context.show(example_validator.outputs['anomalies'])
NotFoundError: /home/jovyan/pipeline/ExampleValidator/anomalies/16/anomalies.pbtxt; No such file or directory
The actual directory structure was like so:
.
└── anomalies
└── 16
├── eval
│ └── anomalies.pbtxt
├── test
│ └── anomalies.pbtxt
└── train
└── anomalies.pbtxt
5 directories, 3 files
but the code seemed to expect:
└── anomalies
└── 16
└── anomalies.pbtxt
How do I call ExampleValidator to analyze split data sets?
Thanks #Lorin S., for sharing the solution reference. For the benefit of community I am providing solution here (answer section) given by 1025KB in github.
Added split in TFX 0.23 version, but Colab is not updated in 0.23.
Colab is fixed in 0.24 here
Issue was resolved by upgrading tfx to 0.24

Correct cmake setup to include headers

I have a project structured like this:
─root
├──src
│ ├──main.cpp
│ └──CMakeLists.txt[2]
├──build
├──out
├──inc
├──dep
│ ├──log
│ │ ├──include
│ │ │ └──log.h
│ │ ├──src
│ │ │ └──log.cpp
│ │ └──CMakeLists.txt[4]
│ └──CMakeLists.txt[3]
└──CMakeLists.txt[1]
Under dep I have a logging library, which is an external git repository with his own CMakeLists.txt file.
The main CMakeLists.txt (marked as [1]) is:
cmake_minimum_required(VERSION 2.6)
set(APP_ROOT ${PROJECT_SOURCE_DIR})
add_subdirectory(dep)
add_subdirectory(src)
The CMakeLists.txt (marked as [2]) for the current project code is:
add_executable(app main.cpp)
target_link_libraries(app log)
include_directories("${APP_ROOT}/inc")
The CMakeLists.txt (marked as [3]) for the dependencies is:
add_subdirectory(log)
What I'm trying to do is to have the contents of the dep/log/include folder copied inside a new folder called inc/log, so that in main.cpp I can write something like #include <log/log.h>, but I don't understand how. I would like to avoid editing the CMakeLists.txt of the logger project.
My solution: in /dep/CMakeLists.txt I added
file(MAKE_DIRECTORY "${APP_ROOT}/inc/log")
file(COPY "log/include/" DESTINATION "${APP_ROOT}/inc/log")