When I run inception preprocessing script, it fails - machine-learning

When I run bazel-bin/inception/download_and_preprocess_imagenet "${DATA_DIR}" the error message:
bazel-bin/inception/inception/download_and_preprocess_imagenet: line 66: bazel-bin/inception/inception/download_and_preprocess_imagenet.runfiles_make_/inception/inception/data
/download_imagenet.sh: No such file or directory
Could someone please tell me what I am doing wrong? I followed the instructions at here

Tensorflow's models repository has a very confusing structure, and you're in the wrong directory. The tree looks like this:
models/
BUILD
WORKSPACE
inception/
BUILD
WORKSPACE
inception/
data/
...
I'm pretty if you ran pwd it would say models. However, the download_and_preprocess_imagenet assumes you'll be in models/inception. So, do:
cd inception
bazel build //inception:download_and_preprocess_imagenet
Then bazel-bin/inception/download_and_preprocess_imagenet should work properly.

Related

WAF.IO how to start compile?

my question my look silly but I'm complete yellow bird in programming.
Have challenge to compile using waf.io. I went thru basic instructions https://waf.io/apidocs/tutorial.html?highlight=start. But there is missing basic information: where I should put all these commands?
You must put these commands in a file named wscript. This file should be in the directory where your other project files are.
Then you will use the waf command in the same directory to run it.
Look at the waf book.

.env file Flaged as not being an object when deploying trough DevOps CD pipeline

I have just created a .env file to separate my environment variables from my main docker-compose file. I can run this document on my local machine fine with no errors or issues but when I try run it through my CD pipeline I get the following error.
[error]Top level object in 'C:\BuildAgent_work\r38\a\"Myproject Name"\drop\ .env' needs to be an object not 'class 'str'.
I first thought this was because I had set up my build/CI process wrong but I have played around with it and have had no luck.
I have also done some research online to find others with the same problem but none relate to DevOps in anyway so it has been unhelpful
I am not sure how to reproduce this problem but if anyone knows I can try provide some of my code if needed
Edit:
Here is a snippet of my .env file. Check comment below for my thoughts
ContainerInfrastructure_Version=6.7.93-beta.1
ContainerInfrastructureCore_Version=6.7.41-beta.1
AuthenticationWebService_Version=6.7.52-beta.1
CRM_Version=6.7.52-beta.1
Expected result:
Deploys successfully
What I'm getting during the docker-compose task:
[error]Top level object in 'C:\BuildAgent_work\r38\a\Goldpine.ReleaseManagement\drop.env' needs to be an object not 'class 'str'.
Ok so I figured it out. I'm not sure how to explain this briefly but I'll do my best.
So the problem was within DevOps itself not my code. It turns out a .env file only works/gets picked up if you run the docker-compose command from within the working directory that the docker-compose.yml file exists.
When it went into DevOps it was not running the command from within the downloaded artefact directory but by creating a path to it using the -f command.
So long story short, If you use a .env file you need to set the working directory within the CD pipeline to your artefact folder for it to be able to see the .env file correctlly.
I hope this is clear enough if not just let me know and I'll try change it accordingly :)

How to install waf?

I have cloned and built the waf script using:
./waf-light configure
Then to build my project (provided by Gomspace) I need to add waf and the eclipse.py to my path. So far I haven't found better than this setenv script:
WAFROOT=~/git/waf/
export PYTHONPATH=$WAFROOT/waflib/extras/:$PYTHONPATH
export PATH=~/git/waf/:$PATH
Called with:
source setenv
This is somehow a pretty ugly solution. Is there a more elegant way to install waf?
You don't install waf. The command you found correctly builds waf: /waf-light configure build Then for each project you create, you put the built waf script into that projects root directory. I can't find a reference, but this is the way in which waf:s primary author Thomas Nagy wants the tool to be used. Projects that repackage waf to make the tool installable aren't "officially sanctioned."
There are advantages and disadvantages with non-installation:
Disadvantages:
You have to add the semi-binary 100kb large waf file to your repository.
Because the file contains binary code, people can have legal objections to distributing it.
Advantages:
It doesn't matter if new versions of waf break the old API.
Users don't need to install waf before compiling the project -- having Python on the system is enough.
Fedora (at least Fedora 22) has a yum package for waf, so you could see that it's possible to do a system install of waf, albeit with a hack.
After you run something like python3 ./waf-light configure build, you'll get a file called waf that's actually a Python script with some binary data at the end. If you put it into /usr/bin and run it as non-root, you'll get an error because it fails to create a directory in /usr/bin. If you run it as root, you'll get the new directory and /usr/bin/waf runs normally.
Here's the trick that I learned from examining the find_lib() function in the waf Python script.
Copy the waf to /usr/bin/waf
As root, run /usr/bin/waf. Notice that it creates a directory. You'll see something like /usr/bin/.waf-2.0.19-b2f63c807a4215294bf6005410c74c18
mv that directory to /usr/lib, dropping the . in the directory name, e.g. mv /usr/bin/.waf-2.0.19-b2f63c807a4215294bf6005410c74c18 /usr/lib/waf-2.0.19-b2f63c807a4215294bf6005410c74c18
If you want to use waf with Python3, repeat Steps 2-3 running the Python script /usr/bin/waf under Python3. Under Python3, the directory names will start with .waf3-/waf3- instead instead of .waf-/waf-.
(Optional) Remove the binary data at the end of /usr/bin/waf.
Now, non-root should be able to just use /usr/bin/waf.
That said, here's something to consider, like what another answer said: I believe waf's author intended waf to be embedded in projects so that each project can use its own version of waf without fear that a project will fail to build when there are newer versions of waf. Thus, the one-global-version use case seems to be not officially supported.

In ns-3, can ./waf --run a code in a nested folder more than two levels of folder?

3 and hope this question is not too stupid... I'm recently using ns-3 and try to compile the codes. I found that I don't need to explicitly specify compilation, instead, using
./waf --run someCode.cc
will first compile and code and then execute it. My question is, I'm trying to compile/run the code in a deeper folder. To be precise, I want to execute one example code located in
<ns-3.22>/src/lte/example/lena-simple-epc.cc
but when I enter
./waf --run src/lte/example/lena-simple-epc
I just got the following message:
Waf: Entering directory `..../ns-allinone-3.22/ns-3.22/build'
program 'src/lte/examples/lena-simple-epc' not found; available programs are: [...]
But, if I copy the file src/lte/examples/lena-simple-epc.cc under the folder scratch and execute ./waf --run scratch/lena-simple-epc, then it works perfectly. Is this expected or did I miss any step? (Forgot to export some environment variables or something?)
You don't need to specify all the path!
Just run:
./waf --run lena-simple-epc
If you are not secure on how to start a script just look at the wscript file in the examples folder and look for these rows.
obj = bld.create_ns3_program('lena-simple-epc',
['lte'])
obj.source = 'lena-simple-epc.cc'
With lena-simple-epc you can start the script.

Running Comparison Tests in Rails

I'm working on my copy of project XYZ; and Bob is working on his copy of project XYZ as well.
Bobs project has a few minute changes than mine; only I don't know where they are.
Other than using github, how can I run and compare my folder against someone else's, and see all of the differences between the two? Is there a way to do this in terminal locally?
Thanks!
If you are in Linux run this command
$ diff dir1 dir2
This will show the list of differences between folders including difference in file contents.

Resources