vt-vl-lab / 3d-photo-inpainting

[CVPR 2020] 3D Photography using Context-aware Layered Depth Inpainting

Home Page:https://shihmengli.github.io/3D-Photo-Inpainting/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

colab RuntimeError and FileNotFoundError

kkur0same opened this issue · comments

commented

after I ran !python main.py --config argument.yml
the error shown as below:

running on device 0
0% 0/1 [00:00<?, ?it/s]Current Source ==> output1
Running depth extraction at 1674971321.124811
BoostingMonocularDepth/inputs/*.jpg
device: cuda
Namespace(Final=True, R0=False, R20=False, colorize_results=False, data_dir='inputs/', depthNet=0, max_res=inf, net_receptive_field_size=None, output_dir='outputs', output_resolution=1, pix2pixsize=1024, savepatchs=0, savewholeest=0)
----------------- Options ---------------
Final: True [default: False]
R0: False
R20: False
aspect_ratio: 1.0
batch_size: 1
checkpoints_dir: ./pix2pix/checkpoints
colorize_results: False
crop_size: 672
data_dir: inputs/ [default: None]
dataroot: None
dataset_mode: depthmerge
depthNet: 0 [default: None]
direction: AtoB
display_winsize: 256
epoch: latest
eval: False
generatevideo: None
gpu_ids: 0
init_gain: 0.02
init_type: normal
input_nc: 2
isTrain: False [default: None]
load_iter: 0 [default: 0]
load_size: 672
max_dataset_size: 10000
max_res: inf
model: pix2pix4depth
n_layers_D: 3
name: void
ndf: 64
netD: basic
netG: unet_1024
net_receptive_field_size: None
ngf: 64
no_dropout: False
no_flip: False
norm: none
num_test: 50
num_threads: 4
output_dir: outputs [default: None]
output_nc: 1
output_resolution: None
phase: test
pix2pixsize: None
preprocess: resize_and_crop
savecrops: None
savewholeest: None
serial_batches: False
suffix:
verbose: False
----------------- End -------------------
initialize network with normal
loading the model from ./pix2pix/checkpoints/mergemodel/latest_net_G.pth
Loading weights: midas/model.pt
Using cache found in /root/.cache/torch/hub/facebookresearch_WSL-Images_main
start processing
processing image 0 : output1
wholeImage being processed in : 2112
Traceback (most recent call last):
File "run.py", line 580, in
run(dataset_, option_)
File "run.py", line 125, in run
whole_estimate = doubleestimate(img, option.net_receptive_field_size, whole_image_optimal_size,
File "run.py", line 389, in doubleestimate
estimate1 = singleestimate(img, size1, net_type)
File "run.py", line 418, in singleestimate
return estimatemidas(img, msize)
File "run.py", line 475, in estimatemidas
prediction = midasmodel.forward(sample)
File "/content/3d-photo-inpainting/BoostingMonocularDepth/midas/models/midas_net.py", line 59, in forward
layer_1 = self.pretrained.layer1(x)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/container.py", line 100, in forward
input = module(input)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/activation.py", line 94, in forward
return F.relu(input, inplace=self.inplace)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/functional.py", line 912, in relu
result = torch.relu_(input)
RuntimeError: CUDA error: no kernel image is available for execution on the device
0% 0/1 [12:03<?, ?it/s]
Traceback (most recent call last):
File "main.py", line 54, in
run_boostmonodepth(sample['ref_img_fi'], config['src_folder'], config['depth_folder'])
File "/content/3d-photo-inpainting/boostmonodepth_utils.py", line 41, in run_boostmonodepth
depth = imageio.imread(os.path.join(BOOST_BASE, BOOST_OUTPUTS, tgt_name))
File "/usr/local/lib/python3.8/dist-packages/imageio/core/functions.py", line 265, in imread
reader = read(uri, format, "i", **kwargs)
File "/usr/local/lib/python3.8/dist-packages/imageio/core/functions.py", line 172, in get_reader
request = Request(uri, "r" + mode, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/imageio/core/request.py", line 124, in init
self._parse_uri(uri)
File "/usr/local/lib/python3.8/dist-packages/imageio/core/request.py", line 260, in _parse_uri
raise FileNotFoundError("No such file: '%s'" % fn)
FileNotFoundError: No such file: '/content/3d-photo-inpainting/BoostingMonocularDepth/outputs/output1.png

Anyone knows how to fix this? Appreciate!

I don't know what I'm doing, but this worked for me:

Run the 'Prepare environment' twice
Run the 'Download script and pretrained model' twice

Go to the file browser (little folder icon in top lef)
Open main.py

Edit line 29 to:

config = yaml.safe_load(open(args.config, 'r'))

Run the rest of the cells

I found a Colab solution here, it works with Python 3.8