stargan-v2-tensorflow icon indicating copy to clipboard operation
stargan-v2-tensorflow copied to clipboard

Buffer Size Error

Open TobiGee opened this issue 4 years ago • 15 comments

Hello together!

When trying to train (only using the Files that were provided, no own data (yet)). I encounter the following error: tensorflow.python.framework.errors_impl.InvalidArgumentError: buffer_size must be greater than zero. [Op:ShuffleDatasetV2]

Full Error Stack: Traceback (most recent call last): File "main.py", line 117, in main() File "main.py", line 103, in main gan.build_model() File "C:\Users\TOGERLA\Desktop\stargan-v2-tensorflow-master\StarGAN_v2.py", line 138, in build_model img_and_domain = img_and_domain.shuffle(buffer_size=dataset_num, reshuffle_each_iteration=True).repeat() File "C:\Users\TOGERLA\Desktop\stargan-v2-tensorflow-master\venv\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 1193, in shuffle return ShuffleDataset(self, buffer_size, seed, reshuffle_each_iteration) File "C:\Users\TOGERLA\Desktop\stargan-v2-tensorflow-master\venv\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 3535, in init **self._flat_structure) File "C:\Users\TOGERLA\Desktop\stargan-v2-tensorflow-master\venv\lib\site-packages\tensorflow_core\python\ops\gen_dataset_ops.py", line 5221, in shuffle_dataset_v2 _ops.raise_from_not_ok_status(e, name) File "C:\Users\TOGERLA\Desktop\stargan-v2-tensorflow-master\venv\lib\site-packages\tensorflow_core\python\framework\ops.py", line 6606, in raise_from_not_ok_status six.raise_from(core._status_to_exception(e.code, message), None) File "", line 3, in raise_from tensorflow.python.framework.errors_impl.InvalidArgumentError: buffer_size must be greater than zero. [Op:ShuffleDatasetV2]

I might be able to fix the issue myself, but I'll still try to document it here for other people to reproduce :)

Have a nice Christmas! Tobias

TobiGee avatar Dec 21 '20 13:12 TobiGee

Edit: The issue is that it gets no images because:

  • In the utils.py File in when the method preprocess of the class Image_data is executed, it tries to enumerate over self.domain_list
  • Domain list is an empty list and should be given to the constructor as second last element
  • If I watch main.py line 100 -> the contructor is called with a list of args
  • If i print these args, I find they're empty, so lets take a look at the parse_args method
  • This method uses argparse to parse the arguments given by the command prompt
  • Big Issue: The args list was empty, althow defaults were defined within the method....
  • I'll try to find out more tomorrow...

TobiGee avatar Dec 21 '20 15:12 TobiGee

i found that when i start the main.py file without any args, it works with the default values. I could also easily reproduce the error with a second Computer. Win 10 GTX 1070 / Quadro P6000

Im pretty confident im missing out something. I'm not experienced with argparse, i guess the issue lies there... can someone help please :)

TobiGee avatar Dec 22 '20 10:12 TobiGee

i found that when i start the main.py file without any args, it works with the default values. I could also easily reproduce the error with a second Computer. Win 10 GTX 1070 / Quadro P6000

Im pretty confident im missing out something. I'm not experienced with argparse, i guess the issue lies there... can someone help please :)

Have U solved it?Cuz I have the same problem as you and I have no any solutioon.Could you tell me how to fix it?please.

KangLeeShaw avatar Jan 12 '21 11:01 KangLeeShaw

I have the same problem sa you,Have you solved it in the end?

Zhenggen-deng avatar Apr 12 '21 02:04 Zhenggen-deng

你是中国人对吗?对不起,我不能帮到你什么。因为我放弃了用starGAN v2做我的研究

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年4月12日(星期一) 上午10:58 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [clovaai/stargan-v2-tensorflow] Buffer Size Error (#10)

I have the same problem sa you,Have you solved it in the end?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

KangLeeShaw avatar Apr 12 '21 09:04 KangLeeShaw

你是中国人对吗?对不起,我不能帮到你什么。因为我放弃了用starGAN v2做我的研究 ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年4月12日(星期一) 上午10:58 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [clovaai/stargan-v2-tensorflow] Buffer Size Error (#10) I have the same problem sa you,Have you solved it in the end? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

是的,我也打算用stargan做研究,你有联系方式吗?QQ /wechat?我们可以一起探讨一下

Zhenggen-deng avatar Apr 13 '21 14:04 Zhenggen-deng

可以 我的QQ是3489330389 hhh 这就是我的QQ邮箱鸭。

------------------ 原始邮件 ------------------ 发件人: "clovaai/stargan-v2-tensorflow" @.>; 发送时间: 2021年4月13日(星期二) 晚上10:16 @.>; @.@.>; 主题: Re: [clovaai/stargan-v2-tensorflow] Buffer Size Error (#10)

你是中国人对吗?对不起,我不能帮到你什么。因为我放弃了用starGAN v2做我的研究 … ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年4月12日(星期一) 上午10:58 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [clovaai/stargan-v2-tensorflow] Buffer Size Error (#10) I have the same problem sa you,Have you solved it in the end? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

是的,我也打算用stargan做研究,你有联系方式吗?QQ /wechat?我们可以一起探讨一下

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

KangLeeShaw avatar Apr 13 '21 14:04 KangLeeShaw

可以 我的QQ是3489330389 hhh 这就是我的QQ邮箱鸭。 ------------------ 原始邮件 ------------------ 发件人: "clovaai/stargan-v2-tensorflow" @.>; 发送时间: 2021年4月13日(星期二) 晚上10:16 @.>; @.@.>; 主题: Re: [clovaai/stargan-v2-tensorflow] Buffer Size Error (#10) 你是中国人对吗?对不起,我不能帮到你什么。因为我放弃了用starGAN v2做我的研究 … ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年4月12日(星期一) 上午10:58 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [clovaai/stargan-v2-tensorflow] Buffer Size Error (#10) I have the same problem sa you,Have you solved it in the end? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. 是的,我也打算用stargan做研究,你有联系方式吗?QQ /wechat?我们可以一起探讨一下 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

为什么加好友还要填你的名字,要不你加我微信把;18273894594

Zhenggen-deng avatar Apr 13 '21 14:04 Zhenggen-deng

Edit: The issue is that it gets no images because:

  • In the utils.py File in when the method preprocess of the class Image_data is executed, it tries to enumerate over self.domain_list
  • Domain list is an empty list and should be given to the constructor as second last element
  • If I watch main.py line 100 -> the contructor is called with a list of args
  • If i print these args, I find they're empty, so lets take a look at the parse_args method
  • This method uses argparse to parse the arguments given by the command prompt
  • Big Issue: The args list was empty, althow defaults were defined within the method....
  • I'll try to find out more tomorrow...

Were you able to solve this issue?

tranzmatt avatar Oct 26 '21 20:10 tranzmatt

Hi. I got the same problem and I realized that I inputted my dataset name incorrectly. Mabey you're doing that too.

mhdabbasi avatar Oct 30 '21 06:10 mhdabbasi

Thx for your reply so much though I didn't do it anymore.

------------------ 原始邮件 ------------------ 发件人: "clovaai/stargan-v2-tensorflow" @.>; 发送时间: 2021年10月30日(星期六) 下午2:19 @.>; @.@.>; 主题: Re: [clovaai/stargan-v2-tensorflow] Buffer Size Error (#10)

Hi. I got the same problem and I realized that I inputted my dataset name incorrectly. Mabey you're doing that too.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

KangLeeShaw avatar Oct 30 '21 06:10 KangLeeShaw

Hello, I have the same problem, if it is solved, can you give me some help

xiaochuangshu avatar Nov 23 '21 09:11 xiaochuangshu

你好,请问是怎么解决的呢?可以帮助我吗?

Yike-98 avatar Dec 06 '21 07:12 Yike-98

不好意思 不能帮到你。我没有复现那个模型了。

------------------ 原始邮件 ------------------ 发件人: "clovaai/stargan-v2-tensorflow" @.>; 发送时间: 2021年12月6日(星期一) 下午3:38 @.>; @.@.>; 主题: Re: [clovaai/stargan-v2-tensorflow] Buffer Size Error (#10)

你好,请问是怎么解决的呢?可以帮助我吗?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

KangLeeShaw avatar Dec 06 '21 07:12 KangLeeShaw

For those seeing the errors, use the following .. "celeba_hq_gender" is being shown incorrectly in github python main.py --dataset celeba_hq_gender --phase train ..

sr1dh4r avatar Aug 01 '23 08:08 sr1dh4r