PhotoSketch icon indicating copy to clipboard operation
PhotoSketch copied to clipboard

SUGGESTION

Open GitHubEmploy opened this issue 3 years ago • 3 comments

Hey man, I built u a ipynb file for collab. u can run it in like 3 seconds now for free.

Heres the colab: https://colab.research.google.com/drive/1Jd_bwcu96KNk8ev0E3gCpL2ryte15U7B?usp=sharing

GitHubEmploy avatar Mar 02 '21 21:03 GitHubEmploy

Sorry, I forgot to give u permissions, heres the updated link: https://colab.research.google.com/drive/1Jd_bwcu96KNk8ev0E3gCpL2ryte15U7B?usp=sharing

GitHubEmploy avatar Mar 03 '21 17:03 GitHubEmploy

Hi, thanks for the suggestion! I am surprised that my old codebase works with the latest PyTorch

mtli avatar Mar 03 '21 18:03 mtli

-------------- End ---------------- CustomDatasetDataLoader dataset [TestDirDataset] was created pix2pix initialization method [normal] Traceback (most recent call last): File "test_pretrained.py", line 29, in <module> main() File "test_pretrained.py", line 18, in main model = create_model(opt) File "/content/PhotoSketch/models/models.py", line 10, in create_model model.initialize(opt) File "/content/PhotoSketch/models/pix2pix_model.py", line 32, in initialize self.load_network(self.netG, 'G', opt.which_epoch) File "/content/PhotoSketch/models/base_model.py", line 54, in load_network network.load_state_dict(torch.load(save_path)) File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 581, in load with _open_file_like(f, 'rb') as opened_file: File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 230, in _open_file_like return _open_file(name_or_buffer, mode) File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 211, in __init__ super(_open_file, self).__init__(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: '/Exp/PhotoSketch/Checkpoints/pretrained/latest_net_G.pth'

@GitHubEmploy bro how to solve this ?

tom99763 avatar Dec 19 '21 07:12 tom99763

-------------- End ---------------- CustomDatasetDataLoader dataset [TestDirDataset] was created pix2pix initialization method [normal] Traceback (most recent call last): File "test_pretrained.py", line 29, in <module> main() File "test_pretrained.py", line 18, in main model = create_model(opt) File "/content/PhotoSketch/models/models.py", line 10, in create_model model.initialize(opt) File "/content/PhotoSketch/models/pix2pix_model.py", line 32, in initialize self.load_network(self.netG, 'G', opt.which_epoch) File "/content/PhotoSketch/models/base_model.py", line 54, in load_network network.load_state_dict(torch.load(save_path)) File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 581, in load with _open_file_like(f, 'rb') as opened_file: File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 230, in _open_file_like return _open_file(name_or_buffer, mode) File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 211, in __init__ super(_open_file, self).__init__(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: '/Exp/PhotoSketch/Checkpoints/pretrained/latest_net_G.pth'

@GitHubEmploy bro how to solve this ?

add a last cell:

dataDir='/content'
!cd PhotoSketch/ && python test_pretrained.py \
    --name pretrained \
    --dataset_mode test_dir \
    --dataroot examples/ \
    --results_dir {dataDir}/PhotoSketch/Results/ \
    --checkpoints_dir {dataDir}/PhotoSketch/ \
    --model pix2pix \
    --which_direction AtoB \
    --norm batch \
    --input_nc 3 \
    --output_nc 1 \
    --which_model_netG resnet_9blocks \
    --no_dropout

FredWe avatar Jan 24 '24 08:01 FredWe

-------------- End ---------------- CustomDatasetDataLoader dataset [TestDirDataset] was created pix2pix initialization method [normal] Traceback (most recent call last): File "test_pretrained.py", line 29, in <module> main() File "test_pretrained.py", line 18, in main model = create_model(opt) File "/content/PhotoSketch/models/models.py", line 10, in create_model model.initialize(opt) File "/content/PhotoSketch/models/pix2pix_model.py", line 32, in initialize self.load_network(self.netG, 'G', opt.which_epoch) File "/content/PhotoSketch/models/base_model.py", line 54, in load_network network.load_state_dict(torch.load(save_path)) File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 581, in load with _open_file_like(f, 'rb') as opened_file: File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 230, in _open_file_like return _open_file(name_or_buffer, mode) File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 211, in __init__ super(_open_file, self).__init__(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: '/Exp/PhotoSketch/Checkpoints/pretrained/latest_net_G.pth'

@GitHubEmploy bro how to solve this ?

or use my little fork: https://colab.research.google.com/drive/15f54uVWt-92jzGc9z44qOX_PRtJCv2tB?usp=sharing

FredWe avatar Jan 24 '24 08:01 FredWe

Hi you were trying to use the pretrained model, please download it first on the project readme page.

mtli avatar Jan 25 '24 02:01 mtli