richzhang / colorization-pytorch

PyTorch reimplementation of Interactive Deep Colorization
https://richzhang.github.io/ideepcolor/
MIT License
597 stars 113 forks source link

I run this project on Colab,Then I encounter a problem #15

Open meiguoofa opened 4 years ago

meiguoofa commented 4 years ago

The error information is No such file or directory: './dataset/ilsvrc2012/val/1/ILSVRC2012_val_00000059.JPEG',But I can find this image in the directory,Your prompt attention to my question is appreciated,Thanks for your help!!

malcolm1232 commented 3 years ago

Geez.... i love his work though!! i got the same problem.. was trying so hard to figure why i had this as well...

Any suggestions would be very well appreciated!!

meiguoofa commented 3 years ago

I solve this problem by changing the path to the path that you specify , the args is in the train_options.py ,so change it and do not execute the make_ilsvrc_dataset.py

malcolm1232 commented 3 years ago

Hi @meiguoofa !! good afternoon from Singapore!! Sorry for the late reply.. been trying out what u said.. but to no avail, erms.. do you mind explaining what u did in a tad bit more detail?

Thank you in advance!!

meiguoofa commented 3 years ago

What's your error information? you should change the dataset path that you specify in the train_options.py

malcolm1232 commented 3 years ago

heyy!!

hmm the train_options.py is as shown:

from .base_options import BaseOptions

class TrainOptions(BaseOptions): def initialize(self, parser): BaseOptions.initialize(self, parser) parser.add_argument('--display_freq', type=int, default=10000, help='frequency of showing training results on screen') parser.add_argument('--display_ncols', type=int, default=5, help='if positive, display all images in a single visdom web panel with certain number of images per row.') parser.add_argument('--update_html_freq', type=int, default=10000, help='frequency of saving training results to html') parser.add_argument('--print_freq', type=int, default=200, help='frequency of showing training results on console') parser.add_argument('--save_latest_freq', type=int, default=5000, help='frequency of saving the latest results') parser.add_argument('--save_epoch_freq', type=int, default=1, help='frequency of saving checkpoints at the end of epochs') parser.add_argument('--epoch_count', type=int, default=0, help='the starting epoch count, we save the model by ,

+, ...') parser.add_argument('--niter', type=int, default=100, help='# of iter at starting learning rate') parser.add_argument('--niter_decay', type=int, default=100, help='# of iter to linearly decay learning rate to zero') parser.add_argument('--beta1', type=float, default=0.9, help='momentum term of adam') parser.add_argument('--lr', type=float, default=0.0001, help='initial learning rate for adam') parser.add_argument('--no_lsgan', action='store_true', help='do *not* use least square GAN, if false, use vanilla GAN') parser.add_argument('--lambda_GAN', type=float, default=0., help='weight for GAN loss') parser.add_argument('--lambda_A', type=float, default=1., help='weight for cycle loss (A -> B -> A)') parser.add_argument('--lambda_B', type=float, default=1., help='weight for cycle loss (B -> A -> B)') parser.add_argument('--lambda_identity', type=float, default=0.5, help='use identity mapping. Setting lambda_identity other than 0 has an effect of scaling the weight of the identity mapping loss.' 'For example, if the weight of the identity loss should be 10 times smaller than the weight of the reconstruction loss, please set lambda_identity = 0.1') parser.add_argument('--pool_size', type=int, default=50, help='the size of image buffer that stores previously generated images') parser.add_argument('--no_html', action='store_true', help='do not save intermediate training results to [opt.checkpoints_dir]/[opt.name ]/web/') parser.add_argument('--lr_policy', type=str, default='lambda', help='learning rate policy: lambda|step|plateau') parser.add_argument('--lr_decay_iters', type=int, default=50, help='multiply by a gamma every lr_decay_iters iterations') parser.add_argument('--avg_loss_alpha', type=float, default=.986, help='exponential averaging weight for displaying loss') self.isTrain = True return parser which part of it did u change? On Wed, Nov 25, 2020 at 6:49 PM meiguoofa wrote: > What's your error information? you should change the dataset path that you > specify in the train_options.py > > β€” > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > , > or unsubscribe > > . >
meiguoofa commented 3 years ago

Sorry,my previous answer may be misleading to you in the base_option.py parser.add_argument('--phase', type=str, default='val', help='train_small, train, val, test, etc') the phase change to train and in the train.py "opt.dataroot = './dataset/ilsvrc2012/%s/' % opt.phase" change to the dataset path that you specify

malcolm1232 commented 3 years ago

Oh im almost there! i did as per instructed.. but when running python test.py --name siggraph_caffemodel --mask_cent 0

I get:

Traceback (most recent call last): File "test.py", line 54, in data_raw[0] = util.crop_mult(data_raw[0], mult=8) File "/home/malcomtan/colorization-pytorch/util/util.py", line 277, in crop_mult return data[:,:,h:h+Hnew,w:w+Wnew] TypeError: slice indices must be integers or None or have an index method

Hmmm, may i know if u did any changes to test.py? Sorry its 11 pm here.. still trying to get it working hahahhaa xDD im so close!!

On Wed, Nov 25, 2020 at 8:53 PM meiguoofa notifications@github.com wrote:

Sorry,my previous answer may be misleading to you in the base_option.py parser.add_argument('--phase', type=str, default='val', help='train_small, train, val, test, etc') the phase change to train and in the train.py "opt.dataroot = './dataset/ilsvrc2012/%s/' % opt.phase" change to the dataset path that you specify

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/richzhang/colorization-pytorch/issues/15#issuecomment-733688890, or unsubscribe https://github.com/notifications/unsubscribe-auth/APZCGIX3FEIFLO3QG4GZFVLSRT46JANCNFSM4SMXUBGA .

malcolm1232 commented 3 years ago

oh yes, i realized its a numpy thing, installed many different numpy packages!

But still to no avail! hmmm may i know what numpy version you were using? Because now, current numpy version (1.19) doesnt support such indexing.

Just wondering if you're still able to run this repo!

So sorry for the trouble!! but yes, hope you have a good good day!! ^.^

On Wed, Nov 25, 2020 at 10:36 PM malcolm tan malcolmthl95@gmail.com wrote:

Oh im almost there! i did as per instructed.. but when running python test.py --name siggraph_caffemodel --mask_cent 0

I get:

Traceback (most recent call last): File "test.py", line 54, in data_raw[0] = util.crop_mult(data_raw[0], mult=8) File "/home/malcomtan/colorization-pytorch/util/util.py", line 277, in crop_mult return data[:,:,h:h+Hnew,w:w+Wnew] TypeError: slice indices must be integers or None or have an index method

Hmmm, may i know if u did any changes to test.py? Sorry its 11 pm here.. still trying to get it working hahahhaa xDD im so close!!

On Wed, Nov 25, 2020 at 8:53 PM meiguoofa notifications@github.com wrote:

Sorry,my previous answer may be misleading to you in the base_option.py parser.add_argument('--phase', type=str, default='val', help='train_small, train, val, test, etc') the phase change to train and in the train.py "opt.dataroot = './dataset/ilsvrc2012/%s/' % opt.phase" change to the dataset path that you specify

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/richzhang/colorization-pytorch/issues/15#issuecomment-733688890, or unsubscribe https://github.com/notifications/unsubscribe-auth/APZCGIX3FEIFLO3QG4GZFVLSRT46JANCNFSM4SMXUBGA .

meiguoofa commented 3 years ago

Thanks, But sorry, I don’t know about this problem either , if I solve this problem later, I will discuss with you again , If u solve this problem , I hope u can tell me how to solve this problem.πŸ˜„

malcolm1232 commented 3 years ago

yes! definitely!! im trying to solve this problem as well. But if i do, i will DEFINITELY update you! rest assured! you have my word! ^.^

On Thu, Nov 26, 2020 at 10:22 AM meiguoofa notifications@github.com wrote:

Thanks, But sorry, I don’t know about this problem either , if I solve this problem later, I will discuss with you again , If u solve this problem , I hope u can tell me how to solve this problem.πŸ˜„

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/richzhang/colorization-pytorch/issues/15#issuecomment-734034992, or unsubscribe https://github.com/notifications/unsubscribe-auth/APZCGIQPP5QD7JRWJOBJRLTSRW3XVANCNFSM4SMXUBGA .

malcolm1232 commented 3 years ago

@meiguoofa hey i managed to get it working! For the 3 test.py

you just need to run it in python 2.7

meiguoofa commented 3 years ago

Great job!!!!! Thanks 😊

malcolm1232 commented 3 years ago

You're very welcome! Thank you too for helping!! ^.^

On Thu, Nov 26, 2020 at 1:16 PM meiguoofa notifications@github.com wrote:

Great job!!!!! Thanks 😊

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/richzhang/colorization-pytorch/issues/15#issuecomment-734079369, or unsubscribe https://github.com/notifications/unsubscribe-auth/APZCGIXIF4IRMAMH2EGNH33SRXQCFANCNFSM4SMXUBGA .