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

caffe_unet not found on ImageJ #34

Closed
chunbrian16 opened this issue Apr 26, 2019 · 9 comments
Closed

caffe_unet not found on ImageJ #34

chunbrian16 opened this issue Apr 26, 2019 · 9 comments

Comments

@chunbrian16
Copy link

chunbrian16 commented Apr 26, 2019

Hi All,

I was trying to install and test u-net segmentation on some of our biological images. I have ubuntu 16.04 running on VirtualBox, with both frontend and backend running on the same machine. I followed the instructions on the project page to install u-net from pre-built binaries, except that I did not install CUDA as my virtual machine has no gpu, so I was testing with just my cpu. After setting up the environment with the following lines:
export UNET_PATH="$/home/username/u-net"
export PATH="$PATH:$/home/username/u-net/bin"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$/home/username/u-net/lib:/home/username/u-net/extlib"

I tested it by simply typing caffe on the terminal and I got the following:

bash: /home/username/u-net/bin/caffe: cannot execute binary file: Exer format error

I also checked the Shell by using:

echo $SHELL

and I got:

/bin/bash

I ran U-net Segmentation on ImageJ and the error "caffe_unet was not found" came out. As I saw the same question raised by Christian on another thread (#17), I opened imageJ from the shell using the following lines suggested by Christian (Thank you Christian):

cd /home/username/Fiji.app
./ImageJ-linux32

(my username is username)

But I still ran into the same problem.

I'm sorry if that seems a stupid question, as I had very little experience in programming/ubuntu, I would really appreciate it if anyone can help.

Thank you!

Brian

@ThorstenFalk
Copy link
Collaborator

Which package did you install? If you have no cuda libraries you will need the CPU-only variant caffe_unet_package_16.04_cpu.tar.gz otherwise caffe will depend on the availability of cuda functions even if the GPU is not used.

@chunbrian16 chunbrian16 changed the title caffe-unet not found on ImageJ caffe_unet not found on ImageJ Apr 26, 2019
@chunbrian16
Copy link
Author

Hi Thorsten,

I think I missed this part.. How can I install the .tar.gz file?

Thank you!

Brian

@ThorstenFalk
Copy link
Collaborator

Simply download and unpack it with tar xfvz caffe_unet_package_16.04_cpu.tar.gz. You can then safely remove the other folder and rename the unpacked folder caffe_unet_package_16.04_cpu to u-net and it should work as expected.

@ThorstenFalk
Copy link
Collaborator

So the following steps should do (assuming you are currently in your home folder:

wget https://lmb.informatik.uni-freiburg.de/resources/opensource/unet/caffe_unet_package_16.04_cpu.tar.gz
tar xfvz caffe_unet_package_16.04_cpu.tar.gz
rm -rf u-net
mv caffe_unet_package_16.04_cpu u-net

@ThorstenFalk
Copy link
Collaborator

If any of the above fails you maybe need to install missing packages using apt-get install wget tar

@chunbrian16
Copy link
Author

Thank you for your detailed explanation. I tried installing caffe_unet_package_16.04_cpu.tar.gz just now with the code, but the problem still exists. I wonder if I need to completely remove the u-net folder before installing the caffe_unet_package_16.04_cpu.tar.gz, because I had an existing folder which was previously obtained using the following code?:

wget https://lmb.informatik.uni-freiburg.de/resources/opensource/unet/caffe_unet_package_16.04_gpu_no_cuDNN.zip
unzip caffe_unet_package_16.04_cpu.zip

Thanks!

Brian

@ThorstenFalk
Copy link
Collaborator

Hmz, the rm -rf u-net line should have done exactly this. Your error message indicates that when trying to run caffe the binary /home/username/u-net/bin/caffe is selected, so the PATH seems to be fine. Can you provide additional info: First, your virtual machine is 64Bit, yes? The ImageJ-linux32 makes me a little nervous.

Trying to run the 64Bit caffe executable on a a 32Bit machine would explain the cannot execute binary file: Exer format error. To verify the used architecture, please check the output of

uname -a

it should read similar to

Linux unethost 4.15.0-47-generic #50-Ubuntu SMP Wed Mar 13 10:44:52 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

If it prints i686 instead of x86_64 you are running a 32Bit version of Ubuntu and you should definitely install a 64Bit version instead (if your machine is 64Bit, which should be the case if it is from after 2000). Otherwise you will be restricted to at most 4GB of RAM (including OS, Windowing system, ImageJ, ...) which will hardly suffice to run segmentations in reasonable time. If the machine indeed has only 32Bit hardware, you can still try to build caffe_unet, but then the CPU must be so old that you won't have fun with it.

@chunbrian16
Copy link
Author

Hi Thorsten,

My virtual machine is a 32bit. I ran uname -a,

the output is Linux username-VirutalBox 4.15.0-45-generic #48~16.04.1-Ubuntu SMP Tue Jan 29 18:03:19 UTC 2019 i686 i686 i686 GNU/Linux

I will try install a 64bit version now and let you know the result!

Thank you very much!

Brian

@chunbrian16
Copy link
Author

Hi Thorsten,

After some hours on reconfigurating my desktop for installing ubuntu, I have finally got it to work with a 64-bit Ubuntu 16.04. Thank you very much for your kind help! I will now try segment some images with cells embedded in a 3D collagen matrix.

Thanks!

Brian

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

No branches or pull requests

2 participants