GithubHelp home page GithubHelp logo

Comments (21)

MahadevanSrinivasan avatar MahadevanSrinivasan commented on August 15, 2024 4

Thanks for your reply. I did that and get the following error now:

Traceback (most recent call last):
  File "main.py", line 28, in <module>
    vispy.use(app='egl')
  File "/home/md/anaconda2/envs/3DP/lib/python3.7/site-packages/vispy/util/wrappers.py", line 97, in use
    use_app(app)
  File "/home/md/anaconda2/envs/3DP/lib/python3.7/site-packages/vispy/app/_default_app.py", line 47, in use_app
    default_app = Application(backend_name)
  File "/home/md/anaconda2/envs/3DP/lib/python3.7/site-packages/vispy/app/application.py", line 49, in __init__
    self._use(backend_name)
  File "/home/md/anaconda2/envs/3DP/lib/python3.7/site-packages/vispy/app/application.py", line 235, in _use
    raise RuntimeError(msg)
RuntimeError: Could not import backend "EGL":
Could not initialize

from 3d-photo-inpainting.

MahadevanSrinivasan avatar MahadevanSrinivasan commented on August 15, 2024 2

@LemonATsu I checked with Mac and linux different devices but stuck here.

Traceback (most recent call last):
File "main.py", line 68, in
map_location=torch.device(device))
File "/home/dilendra/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/serialization.py", line 529, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/home/dilendra/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/serialization.py", line 702, in _legacy_load
result = unpickler.load()
File "/home/dilendra/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/serialization.py", line 665, in persistent_load
deserialized_objects[root_key] = restore_location(obj, location)
File "/home/dilendra/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/serialization.py", line 740, in restore_location
return default_restore_location(storage, str(map_location))
File "/home/dilendra/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/serialization.py", line 156, in default_restore_location
result = fn(storage, location)
File "/home/dilendra/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/serialization.py", line 132, in _cuda_deserialize
device = validate_cuda_device(location)
File "/home/dilendra/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/serialization.py", line 116, in validate_cuda_device
raise RuntimeError('Attempting to deserialize object on a CUDA '
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.

Set the gpus field in the arugment.yml file to -1 to fallback to CPU

from 3d-photo-inpainting.

LemonATsu avatar LemonATsu commented on August 15, 2024 1

Try setting offscreen_rendering in argument.yml to True to enable rendering without GUI environment.

from 3d-photo-inpainting.

LemonATsu avatar LemonATsu commented on August 15, 2024 1

Try installing EGL by running: sudo apt-get install libgles2-mesa-dev. Let us know if it works. Thanks

from 3d-photo-inpainting.

LemonATsu avatar LemonATsu commented on August 15, 2024 1

@cahitatlas Try run the download.sh script to download all the pre-trained weights.

from 3d-photo-inpainting.

puppet101 avatar puppet101 commented on August 15, 2024

@LemonATsu
I get the same error, but I am using CentOS 7, what packages should I install to run it with offscreen rendering?

from 3d-photo-inpainting.

ShihMengLi avatar ShihMengLi commented on August 15, 2024

Maybe this one?
https://centos.pkgs.org/7/centos-x86_64/mesa-libGLU-devel-9.0.0-4.el7.x86_64.rpm.html

from 3d-photo-inpainting.

MahadevanSrinivasan avatar MahadevanSrinivasan commented on August 15, 2024

Try installing EGL by running: sudo apt-get install libgles2-mesa-dev. Let us know if it works. Thanks

I have that package installed already. But still see the same error

from 3d-photo-inpainting.

sdan avatar sdan commented on August 15, 2024

I've been tackling this issue as well.
I don't see the reason for having all those render() functions in mesh.py. At this point it seems like xvfb-run is the best temporary option.

The weird thing about this is:
It runs perfectly on Colab but on a Docker container or even another Jupyter notebook these vispy issues come up

from 3d-photo-inpainting.

sdan avatar sdan commented on August 15, 2024

The issue here is: regardless of offscreen_render, you will still need vispy's scene module to create canvases for mesh.py to run.

I've installed all the packages but strangely I can't replicate this anywhere other than colab (when I run this on a jupyter notebook I run into "no screen" errors

from 3d-photo-inpainting.

MoePus avatar MoePus commented on August 15, 2024

Try setting offscreen_rendering in argument.yml to True to enable rendering without GUI environment.

This works for win10 wsl unbuntu 18.04

from 3d-photo-inpainting.

dilenpant avatar dilenpant commented on August 15, 2024

@LemonATsu I checked with Mac and linux different devices but stuck here.

Traceback (most recent call last):
File "main.py", line 68, in
map_location=torch.device(device))
File "/home/dilendra/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/serialization.py", line 529, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/home/dilendra/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/serialization.py", line 702, in _legacy_load
result = unpickler.load()
File "/home/dilendra/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/serialization.py", line 665, in persistent_load
deserialized_objects[root_key] = restore_location(obj, location)
File "/home/dilendra/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/serialization.py", line 740, in restore_location
return default_restore_location(storage, str(map_location))
File "/home/dilendra/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/serialization.py", line 156, in default_restore_location
result = fn(storage, location)
File "/home/dilendra/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/serialization.py", line 132, in _cuda_deserialize
device = validate_cuda_device(location)
File "/home/dilendra/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/serialization.py", line 116, in validate_cuda_device
raise RuntimeError('Attempting to deserialize object on a CUDA '
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.

from 3d-photo-inpainting.

MahadevanSrinivasan avatar MahadevanSrinivasan commented on August 15, 2024

Try setting offscreen_rendering in argument.yml to True to enable rendering without GUI environment.

This works for win10 wsl unbuntu 18.04

Did you have to install any new packages? I tried on Win10 WSL Ubuntu 16.04 and it does not work.

from 3d-photo-inpainting.

MoePus avatar MoePus commented on August 15, 2024

Try setting offscreen_rendering in argument.yml to True to enable rendering without GUI environment.

This works for win10 wsl unbuntu 18.04

Did you have to install any new packages? I tried on Win10 WSL Ubuntu 16.04 and it does not work.
Only libgles2-mesa-dev.
My wsl ubuntu is new installed on win10 1909.
And i have aslo run export DISPLAY=:0

from 3d-photo-inpainting.

davideandres95 avatar davideandres95 commented on August 15, 2024

Try setting offscreen_rendering in argument.yml to True to enable rendering without GUI environment.

This works for win10 wsl unbuntu 18.04

Well it does not work in ubuntu 16.04. Any other suggestions?

from 3d-photo-inpainting.

cahitatlas avatar cahitatlas commented on August 15, 2024

I get same problem on macOS Catalina
Normaly when i try with default yml file, i get that result:

(3DP) bash-3.2$ python main.py --config argument.yml
0%| | 0/1 [00:00<?, ?it/s]Current Source ==> einstein
initialize
device: cpu
0%| | 0/1 [00:00<?, ?it/s]
Traceback (most recent call last):
File "main.py", line 44, in
config['MiDaS_model_ckpt'], MonoDepthNet, MiDaS_utils, target_w=640)
File "/Users/cahitatlas/Downloads/3d-photo-inpainting-master/MiDaS/run.py", line 27, in run_depth
model = Net(model_path)
File "/Users/cahitatlas/Downloads/3d-photo-inpainting-master/MiDaS/monodepth_net.py", line 52, in init
self.load(path)
File "/Users/cahitatlas/Downloads/3d-photo-inpainting-master/MiDaS/monodepth_net.py", line 88, in load
parameters = torch.load(path)
File "/Users/cahitatlas/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/serialization.py", line 584, in load
with _open_file_like(f, 'rb') as opened_file:
File "/Users/cahitatlas/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/serialization.py", line 234, in _open_file_like
return _open_file(name_or_buffer, mode)
File "/Users/cahitatlas/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/serialization.py", line 215, in init
super(_open_file, self).init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'MiDaS/model.pt'

I deleted MiDaS_model_ckpt:
than i get result :

Start Running 3D_Photo ...
0%| | 0/1 [00:13<?, ?it/s]
Traceback (most recent call last):
File "main.py", line 66, in
map_location=torch.device(device))
File "/Users/cahitatlas/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/serialization.py", line 584, in load
with _open_file_like(f, 'rb') as opened_file:
File "/Users/cahitatlas/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/serialization.py", line 234, in _open_file_like
return _open_file(name_or_buffer, mode)
File "/Users/cahitatlas/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/serialization.py", line 215, in init
super(_open_file, self).init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'checkpoints/edge-model.pth'

from 3d-photo-inpainting.

lizhengwei1992 avatar lizhengwei1992 commented on August 15, 2024

Try installing EGL by running: sudo apt-get install libgles2-mesa-dev. Let us know if it works. Thanks

I also have the same error "RuntimeError: Could not import backend "EGL":
" after install libgles2-mesa-dev.

from 3d-photo-inpainting.

lizhengwei1992 avatar lizhengwei1992 commented on August 15, 2024

Try installing EGL by running: sudo apt-get install libgles2-mesa-dev. Let us know if it works. Thanks

I have that package installed already. But still see the same error

Use os.environ['DISPLAY']= ':0' in main.py after running: sudo apt-get install libgles2-mesa-dev, fixed it !

from 3d-photo-inpainting.

LemonATsu avatar LemonATsu commented on August 15, 2024

@lizhengwei1992 Thanks for letting us know. This would be useful for others that have the same problem.

from 3d-photo-inpainting.

mohit1997 avatar mohit1997 commented on August 15, 2024

This worked for me while rendering videos on a server,

I specifically changed two things,

On the client-side while logging in, use

ssh -v -X user@server

then in the argument.yml file update

offscreen_rendering: True

from 3d-photo-inpainting.

yfq512 avatar yfq512 commented on August 15, 2024

I solved same error follow this:
vispy/vispy#1848 (comment)

from 3d-photo-inpainting.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.