首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我一直收到StyleGAN的断言错误

我一直收到StyleGAN的断言错误
EN

Stack Overflow用户
提问于 2020-01-09 05:38:25
回答 3查看 2.3K关注 0票数 6

最近,我一直在使用StyleGAN,我已经生成了一个数据集,但是当我尝试运行train.py时,我得到了以下内容。

代码语言:javascript
复制
2020-01-08 13:33:21.943217: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll
WARNING:tensorflow:From C:\Users\MyName\Desktop\StyleGan\stylegan-master\dnnlib\tflib\tfutil.py:34: The name tf.Dimension is deprecated. Please use tf.compat.v1.Dimension instead.

WARNING:tensorflow:From C:\Users\MyName\Desktop\StyleGan\stylegan-master\dnnlib\tflib\tfutil.py:74: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead.

WARNING:tensorflow:From C:\Users\MyName\Desktop\StyleGan\stylegan-master\dnnlib\tflib\tfutil.py:128: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

Creating the run dir: results\00003-sgan-datasets-1gpu
Copying files to the run dir
dnnlib: Running training.training_loop.training_loop() on localhost...
WARNING:tensorflow:From C:\Users\MyName\Desktop\StyleGan\stylegan-master\dnnlib\tflib\tfutil.py:97: The name tf.get_default_session is deprecated. Please use tf.compat.v1.get_default_session instead.

WARNING:tensorflow:From C:\Users\MyName\Desktop\StyleGan\stylegan-master\dnnlib\tflib\tfutil.py:109: The name tf.set_random_seed is deprecated. Please use tf.compat.v1.set_random_seed instead.

WARNING:tensorflow:From C:\Users\MyName\Desktop\StyleGan\stylegan-master\dnnlib\tflib\tfutil.py:132: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.

2020-01-08 13:33:23.904828: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2020-01-08 13:33:23.913674: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll
2020-01-08 13:33:23.945149: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties:
name: GeForce GTX 1660 Ti major: 7 minor: 5 memoryClockRate(GHz): 1.59
pciBusID: 0000:01:00.0
2020-01-08 13:33:23.951080: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll
2020-01-08 13:33:23.957540: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_100.dll
2020-01-08 13:33:23.964398: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_100.dll
2020-01-08 13:33:23.968829: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_100.dll
2020-01-08 13:33:23.975979: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_100.dll
2020-01-08 13:33:23.983341: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_100.dll
2020-01-08 13:33:23.997908: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
2020-01-08 13:33:24.002421: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0
2020-01-08 13:33:24.657141: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-01-08 13:33:24.661322: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165]      0
2020-01-08 13:33:24.663568: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0:   N
2020-01-08 13:33:24.667420: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 4627 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1660 Ti, pci bus id: 0000:01:00.0, compute capability: 7.5)
Streaming data using training.dataset.TFRecordDataset...
Traceback (most recent call last):
  File "train.py", line 190, in <module>
    main()
  File "train.py", line 185, in main
    dnnlib.submit_run(**kwargs)
  File "C:\Users\MyName\Desktop\StyleGan\stylegan-master\dnnlib\submission\submit.py", line 290, in submit_run
    run_wrapper(submit_config)
  File "C:\Users\MyName\Desktop\StyleGan\stylegan-master\dnnlib\submission\submit.py", line 242, in run_wrapper
    util.call_func_by_name(func_name=submit_config.run_func_name, submit_config=submit_config, **submit_config.run_func_kwargs)
  File "C:\Users\MyName\Desktop\StyleGan\stylegan-master\dnnlib\util.py", line 257, in call_func_by_name
    return func_obj(*args, **kwargs)
  File "C:\Users\MyName\Desktop\StyleGan\stylegan-master\training\training_loop.py", line 146, in training_loop
    training_set = dataset.load_dataset(data_dir=config.data_dir, verbose=True, **dataset_args)
  File "C:\Users\MyName\Desktop\StyleGan\stylegan-master\training\dataset.py", line 234, in load_dataset
    dataset = dnnlib.util.get_obj_by_name(class_name)(**adjusted_kwargs)
  File "C:\Users\MyName\Desktop\StyleGan\stylegan-master\training\dataset.py", line 70, in __init__
    assert os.path.isdir(self.tfrecord_dir)
AssertionError

我对StyleGAN仍然非常不熟悉,任何建议都会对我有所帮助。我已经修改了Train.py文件以适应我的单个图形处理器和数据集目录。

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2020-01-09 05:50:59

正如@Chrispresso在这个问题的评论中回答的那样,我在下面一行中引用的目录是无效的,必须将其设置为有效目录。

代码语言:javascript
复制
# Dataset.
    desc += '-dataset';     dataset = EasyDict(tfrecord_dir='dataset', resolution=128); train.mirror_augment = False

(这是在StyleGAN中包含的train.py中的第36行)

票数 2
EN

Stack Overflow用户

发布于 2020-01-09 06:27:30

如果其他任何人有此问题,请确保您的数据集位于名为datasets的目录中。

票数 4
EN

Stack Overflow用户

发布于 2021-09-02 06:25:12

此问题意味着您的数据集地址不正确。给出数据集的正确路径。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59654172

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档