colorization-pytorch icon indicating copy to clipboard operation
colorization-pytorch copied to clipboard

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

Open meiguoofa opened this issue 5 years ago • 13 comments

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!!

meiguoofa avatar Oct 12 '20 12:10 meiguoofa

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!!

malcolm1232 avatar Nov 20 '20 06:11 malcolm1232

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

meiguoofa avatar Nov 21 '20 01:11 meiguoofa

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!!

malcolm1232 avatar Nov 25 '20 06:11 malcolm1232

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

meiguoofa avatar Nov 25 '20 10:11 meiguoofa

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 <epoch_count>, <epoch_count>+<save_latest_freq>, ...') 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 [email protected] 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 https://github.com/richzhang/colorization-pytorch/issues/15#issuecomment-733629391, or unsubscribe https://github.com/notifications/unsubscribe-auth/APZCGIVXTW43E4KQLY74ELTSRTOLVANCNFSM4SMXUBGA .

malcolm1232 avatar Nov 25 '20 11:11 malcolm1232

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

meiguoofa avatar Nov 25 '20 12:11 meiguoofa

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 [email protected] 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 avatar Nov 25 '20 14:11 malcolm1232

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 [email protected] 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 [email protected] 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 avatar Nov 26 '20 01:11 malcolm1232

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.😄

meiguoofa avatar Nov 26 '20 02:11 meiguoofa

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 [email protected] 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 avatar Nov 26 '20 02:11 malcolm1232

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

you just need to run it in python 2.7

malcolm1232 avatar Nov 26 '20 03:11 malcolm1232

Great job!!!!! Thanks 😊

meiguoofa avatar Nov 26 '20 05:11 meiguoofa

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

On Thu, Nov 26, 2020 at 1:16 PM meiguoofa [email protected] 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 .

malcolm1232 avatar Nov 26 '20 05:11 malcolm1232