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

problem executing code #19

Open
sekrin opened this issue Feb 26, 2022 · 2 comments
Open

problem executing code #19

sekrin opened this issue Feb 26, 2022 · 2 comments

Comments

@sekrin
Copy link

sekrin commented Feb 26, 2022

### Are there solutions to make the code work?
These are the errors that made the program not work:

The autoreload extension is already loaded. To reload it, use:
%reload_ext autoreload
------------ Parameters -------------
camera_lr: 0.01
ckpt: checkpoint/stylegan2-ffhq-config-f.pt
coarse_min: 32
color_transfer: 10000000000.0
contextual: 0.1
cx_layers: ['relu3_4', 'relu2_2', 'relu1_2']
e4e_ckpt: checkpoint/e4e_ffhq_encode.pt
e4e_size: 256
encoder_ckpt: checkpoint/encoder/checkpoint_b.pt
encoder_name: b
encoder_size: 256
eye: 0.1
gaussian: 0.75
generator_size: 1024
init_latent: None
input: dataset/أنا1_01.png
log_dir: log/
log_freq: 10
log_visual_freq: 1000
lr: 0.1
mix_layer_range: [10, 18]
noise_ramp: 0.75
noise_regularize: 50000.0
noise_strength: 0.0
rand_seed: None
recon_size: 256
results_dir: results/
spectral_sensitivity: b
vgg: 1
vggface: 0.3
wplus_step: [250, 750]

b-G0.75-init(10,18)-s256-vgg1-vggface0.3-eye0.1-color1.0e+10-cx0.1(relu3_4,relu2_2,relu1_2)-NR5.0e+04-lr0.1_0.01-c32-wp(250,750)

FileNotFoundError Traceback (most recent call last)
in ()
19 results_dir="results/"
20 ))
---> 21 main(args)

5 frames
/content/Time-Travel-Rephotography/projector.py in main(args)
113 # initialize
114 with torch.no_grad():
--> 115 init = Initializer(args).to(device)
116 latent_init = init(imgs_orig)
117

/content/Time-Travel-Rephotography/tools/initialize.py in init(self, args)
114
115 assert args.encoder_size is not None
--> 116 self.color_encoder = create_color_encoder(args)
117 self.color_encoder.eval()
118 self.color_encoder_size = args.encoder_size

/content/Time-Travel-Rephotography/tools/initialize.py in create_color_encoder(args)
73 def create_color_encoder(args: Namespace):
74 encoder = Encoder(1, args.encoder_size, 512)
---> 75 ckpt = torch.load(args.encoder_ckpt)
76 encoder.load_state_dict(ckpt["model"])
77 return encoder

/usr/local/lib/python3.7/dist-packages/torch/serialization.py in load(f, map_location, pickle_module, **pickle_load_args)
592 pickle_load_args['encoding'] = 'utf-8'
593
--> 594 with _open_file_like(f, 'rb') as opened_file:
595 if _is_zipfile(opened_file):
596 # The zipfile reader is going to advance the current file position.

/usr/local/lib/python3.7/dist-packages/torch/serialization.py in _open_file_like(name_or_buffer, mode)
228 def _open_file_like(name_or_buffer, mode):
229 if _is_path(name_or_buffer):
--> 230 return _open_file(name_or_buffer, mode)
231 else:
232 if 'w' in mode:

/usr/local/lib/python3.7/dist-packages/torch/serialization.py in init(self, name, mode)
209 class _open_file(_opener):
210 def init(self, name, mode):
--> 211 super(_open_file, self).init(open(name, mode))
212
213 def exit(self, *args):

FileNotFoundError: [Errno 2] No such file or directory: 'checkpoint/encoder/checkpoint_b.pt'

@StephenHnilica
Copy link

For the "File not found" error, it's because too many people have downloaded the files so Google isn't letting you DL them via API.

I downloaded the models to my gdrive, then mounted it and copied directly from my gdrive. That solved that issue.

@osprey1978
Copy link

For the "File not found" error, it's because too many people have downloaded the files so Google isn't letting you DL them via API.

I downloaded the models to my gdrive, then mounted it and copied directly from my gdrive. That solved that issue.

Hello, please forgive my ignorance but I am somewhat new to Colab, albeit I have been using Time Travel Rephotography for a month. The solution you have offered there sounds like it will fix the current issue (one I posted a couple of days ago here) but I am not sure 'where' to download the models from nor how to 'copy' into the TTR Colab demo. Would you be so kind as to write a quick explainer?

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

3 participants