GithubHelp home page GithubHelp logo

Comments (8)

ruotianluo avatar ruotianluo commented on August 19, 2024

This is because I didn't consider situation when language_eval is false. You can comment this line put.

from imagecaptioning.pytorch.

weiweili123 avatar weiweili123 commented on August 19, 2024

Thanks! It's work

from imagecaptioning.pytorch.

makaaay avatar makaaay commented on August 19, 2024

sorry. I met the same question ,but I don't know how to fix it

from imagecaptioning.pytorch.

ruotianluo avatar ruotianluo commented on August 19, 2024

@makaaay check my reply above.

from imagecaptioning.pytorch.

makaaay avatar makaaay commented on August 19, 2024

emmmm,comment " assert args.language_eval == 0 or args.language_eval == 1" in opts.py ? sorry,I am a new learner in Shanghai.

from imagecaptioning.pytorch.

ruotianluo avatar ruotianluo commented on August 19, 2024

comment out line 152 and line 153 in train.py

from imagecaptioning.pytorch.

makaaay avatar makaaay commented on August 19, 2024

yeah~it works now !
my mate help me in lines150-161.
if tf is not None and isinstance(lang_stats, dict):
add_summary_value(tf_summary_writer, 'validation loss', val_loss, iteration)
for k,v in lang_stats.items():
add_summary_value(tf_summary_writer, k, v, iteration)
tf_summary_writer.flush()
val_result_history[iteration] = {'loss': val_loss, 'lang_stats': lang_stats, 'predictions': predictions}

        # Save model if is improving on validation result
        if opt.language_eval == 1 and isinstance(lang_stats, dict):
            current_score = lang_stats['CIDEr']
        else:
            current_score = - val_loss

it also works!

thank you very much ! happy new year in US and have a bright future in phd.

from imagecaptioning.pytorch.

TalenWang-AIcv avatar TalenWang-AIcv commented on August 19, 2024

@weiweili123 Hi, It seems that you have successfully run @ruotianluo 's code, but I got such an Error as followed, can you give me some help or advice? Thank you very much.

DataLoader loading json file: ./data/cocotalk.json
vocab size is 9487
DataLoader loading h5 file: ./data/cocotalk_fc ./data/cocotalk_att ./data/cocotalk_label.h5
max sequence length in data is 20
read 123287 image features
assigned 113287 images to split train
assigned 5000 images to split val
assigned 5000 images to split test
F:\Miniconda\lib\site-packages\torch\nn\modules\rnn.py:54: UserWarning: dropout option adds dropout after all but last recurrent layer, so non-zero dropout expects num_layers greater than 1, but got dropout=0.5 and num_layers=1
"num_layers={}".format(dropout, num_layers))
Traceback (most recent call last):
File "F:/Research/ImageCaptioning.pytorch-master/train.py", line 211, in
train(opt)
File "F:/Research/ImageCaptioning.pytorch-master/train.py", line 105, in train
data = loader.get_batch('train')
File "F:\Research\ImageCaptioning.pytorch-master\dataloader.py", line 135, in get_batch
ix, tmp_wrapped = self._prefetch_process[split].get()
File "F:\Research\ImageCaptioning.pytorch-master\dataloader.py", line 263, in get
self.reset()
File "F:\Research\ImageCaptioning.pytorch-master\dataloader.py", line 242, in reset
collate_fn=lambda x: x[0]))
File "F:\Miniconda\lib\site-packages\torch\utils\data\dataloader.py", line 193, in iter
return _DataLoaderIter(self)
File "F:\Miniconda\lib\site-packages\torch\utils\data\dataloader.py", line 469, in init
w.start()
File "F:\Miniconda\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "F:\Miniconda\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "F:\Miniconda\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "F:\Miniconda\lib\multiprocessing\popen_spawn_win32.py", line 65, in init
reduction.dump(process_obj, to_child)
File "F:\Miniconda\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'BlobFetcher.reset..'
Terminating BlobFetcher
Traceback (most recent call last):
File "", line 1, in
File "F:\Miniconda\lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "F:\Miniconda\lib\multiprocessing\spawn.py", line 115, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input <

from imagecaptioning.pytorch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.