stefann icon indicating copy to clipboard operation
stefann copied to clipboard

Can't get it to run due to 'integrity failure'.

Open dietercastel opened this issue 3 years ago • 10 comments

Hi,

I was trying out your project but I'm stuck installing dependencies. I tried the conda installation method but it keeps failing (tried cpu, gpu and osx yamls). [DEBUG] Loading application... integrity failure

I also think the yaml file here https://github.com/prasunroy/stefann/blob/acac8fec6985e5e651313472738dbf36bbc27199/release/env_cpu.yml#L12 and here is faulty: https://github.com/prasunroy/stefann/blob/acac8fec6985e5e651313472738dbf36bbc27199/release/env_gpu.yml#L12

I guess it should look more like the OSX version with a double == and tensorflow below pip. https://github.com/prasunroy/stefann/blob/acac8fec6985e5e651313472738dbf36bbc27199/release/env_osx.yml#L10-L15 However even when I edit the env_cpu.yaml that way it seems to fail.

It could be related to this issue: https://github.com/tensorflow/tensorflow/issues/37316 but when I tried tensorflow>=2.1.0 it also failed.

Any idea how to solve this? Or is there an alternative way to install it? A docker container maybe?

dietercastel avatar Aug 16 '20 09:08 dietercastel

Okay after extracting the models/samples (and renaming Models/ to models/) I get a couple steps further. Still I'm having errors.

First I got some CUDA errors which didn't compute since I was running the CPU version in the CPU environment. When I forced using the CPU by adding:

# ensure keras using tensorflow backend
os.environ['KERAS_BACKEND'] = 'tensorflow'
# ensure keras is using CPU, ADDED THIS
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # ADDED THIS
os.environ['CUDA_VISIBLE_DEVICES'] = '-1' # ADDED THIS

I get the following QT-related error. Any idea what to do about this one?

[DEBUG] Loading application... done
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

dietercastel avatar Aug 16 '20 10:08 dietercastel

Hi,

Thanks for your interest in our work. Before releasing this code, I personally tested on Linux and Windows only. A similar problem was later reported and apparently fixed for OSX by another contributor. Please check https://github.com/prasunroy/stefann/pull/1 and https://github.com/prasunroy/stefann/pull/4 for more details.

Unfortunately, I do not have access to an OSX system and therefore, I won't be able to reproduce the issue for now.

prasunroy avatar Aug 17 '20 07:08 prasunroy

Hi,

Thanks for your interest in our work. Before releasing this code, I personally tested on Linux and Windows only. A similar problem was later reported and apparently fixed for OSX by another contributor. Please check #1 and #4 for more details.

Unfortunately, I do not have access to an OSX system and therefore, I won't be able to reproduce the issue for now. Hi, Thanks for your response, I'm eager to try it out since it looks awesome! :-) I looked at those issues but they confused me even more tbh. I got that you reverted the Linux one (env_cpu.yaml) back to the original (which I tested before my additions IRC). I tested it both (combinations) multiple times on OSX and Ubuntu (16) to no avail (finally updating the yaml files as mentioned above).

On Linux which of the YAML files do you use to run it initially on CPU? I suspect the env_cpu.yml worked for you out of the box? Could you maybe explicitly add the versions to the (still) unversioned dependencies in that file? Potentially that could help but I'm not sure.

I might try to make that environment inside a docker container to see whether that helps but that will be for next month at the earliest. If that works I'll definitely contribute it here because that would make using it as simple as docker pull and then running it.

Anyway, thanks for your effort if you have any more ideas I can try I'd love to hear it. :-)

dietercastel avatar Aug 17 '20 10:08 dietercastel

On Linux or Windows you can use any environment (CPU or GPU). GPU environment requires NVIDIA GPU along with appropriate drivers pre-installed. GPU environment is specifically useful during training. For quick testing CPU environment is sufficient.

A docker container might be helpful to get started quickly. Feel free to contribute! 👍

prasunroy avatar Aug 18 '20 06:08 prasunroy

Hi, Thanks for your response, I'm eager to try it out since it looks awesome! :-) I looked at those issues but they confused me even more tbh. I got that you reverted the Linux one (env_cpu.yaml) back to the original (which I tested before my additions IRC). I tested it both (combinations) multiple times on OSX and Ubuntu (16) to no avail (finally updating the yaml files as mentioned above).

TL;DR

Reinstalling xcb apparently fixed the issue. (Source).

sudo apt install --reinstall libxcb-xinerama0

Short Story Long

Sorry for replying a bit late. I went for a completely fresh install while trying to reproduce the issue. I did it on a old laptop without any NVIDIA GPU i.e. a CPU-based installation.

  1. Formatted the system completely and installed Pop!_OS 20.04 LTS which is based on Ubuntu 20.04 LTS.
  2. Updated the OS (usual post installation step).
sudo apt update && sudo apt upgrade
  1. The latest versions of build-essential and git are already pre-installed in Pop!_OS.
  2. Installed Miniconda (Python 3.8 Linux 64-bit). Anaconda should also work just fine but I wanted to keep things minimal.
  3. Followed through steps of Quick installation documented in README.
  4. Followed through steps of Quick test documented in README.
  5. I ran into the same error you reported earlier. :sweat_smile:
[DEBUG] Loading application... done
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
  1. From the error it seems reinstalling xcb may fix the problem. This fact is further confirmed here.
  2. So, I reinstalled xcb.
sudo apt install --reinstall libxcb-xinerama0
  1. Finally, eveything started working as intended. :relaxed:

Screenshot from 2020-08-20 19-00-00 Screenshot from 2020-08-20 19-40-00

In our earlier tests we never faced this issue. So, thanks for reporting. However, it appears to be fixed now. I hope this helps.

prasunroy avatar Aug 20 '20 14:08 prasunroy

Awesome! That solved it!

Good job figuring this out. What would be a more permanent solution for this though? Is this a dependency issue in the OS itself?

This issue can be closed really with the workaround above.

dietercastel avatar Aug 20 '20 19:08 dietercastel

Might be useful to reopen, to make it easier to find.

dietercastel avatar Aug 22 '20 10:08 dietercastel

Idk if it's still related to this issue but I'm having issues running stefann again. Now it aborts with a core dump and the following message:

 Scene Text Editor using Font Adaptive Neural Network.
 Copyright (c) 2019 Prasun Roy, Saumik Bhattacharya and Subhankar Ghosh.
 Copyright (c) 2019 Indian Statistical Institute.
 All Rights Reserved.
...............................................................................


[DEBUG] Loading application... done
QObject::moveToThread: Current thread (0x55ac92ac2080) is not the object's thread (0x55ac969711a0).
Cannot move to target thread (0x55ac92ac2080)

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/dcastel/miniconda3/envs/stefann-cpu/lib/python3.8/site-packages/cv2/qt/plugins" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl.

Aborted (core dumped)

I had the stefann-cpu conda environment active just like last time and didn't really change anything else. (Maybe I ran some updates?) Unfortunatlely reinstalling xcb did not work like last time. Other suggestions? :-)

dietercastel avatar Aug 28 '20 05:08 dietercastel

I've tried to reproduce the error after updating the OS, reinstalling everything in a new environment etc. But I could not reproduce the error on Pop!_OS 20.04 LTS or Windows 10. For me it is working properly on both OS. So, at this point I couldn't find a proper solution. :-(

Have you tried reinstalling the environment? It is apparently related to Qt. So, my guess is reinstalling Qt or building it from source might help. :confused:

prasunroy avatar Aug 29 '20 17:08 prasunroy

Okay after extracting the models/samples (and renaming Models/ to models/) I get a couple steps further. Still I'm having errors.

First I got some CUDA errors which didn't compute since I was running the CPU version in the CPU environment. When I forced using the CPU by adding:

# ensure keras using tensorflow backend
os.environ['KERAS_BACKEND'] = 'tensorflow'
# ensure keras is using CPU, ADDED THIS
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # ADDED THIS
os.environ['CUDA_VISIBLE_DEVICES'] = '-1' # ADDED THIS

I get the following QT-related error. Any idea what to do about this one?

[DEBUG] Loading application... done
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

This issue may not work. In this case try to update tensorflow version.

fronos avatar Dec 20 '22 13:12 fronos