小编SIV*_*GAR的帖子

```AttributeError: 'module' object has no attribute 'set_random_seed'``` 当我从终端运行 ```python2 ./train.py``` 时

完整的错误消息集如下所示:

(FYP_v2) sg97-ubuntu@SG97-ubuntu:~/SGSN$ python2 ./train.py
Traceback (most recent call last):
  File "./train.py", line 165, in <module>
    main()
  File "./train.py", line 65, in main
    tf.set_random_seed(args.random_seed)
AttributeError: 'module' object has no attribute 'set_random_seed'
(FYP_v2) sg97-ubuntu@SG97-ubuntu:~/SGSN$
Run Code Online (Sandbox Code Playgroud)

我在stackoverflow上检查了这个(AttributeError: 'module' object has no attribute 'set_random_seed')问题,但它并不真正适用于我的情况,因为我没有使用 Caffe。

我还提供了下面的python代码以供参考

from __future__ import print_function

import argparse
from datetime import datetime
from random import shuffle
import os
import sys
import time
import math
import tensorflow as tf
import numpy as np

from utils import *
from train_image_reader …
Run Code Online (Sandbox Code Playgroud)

python machine-learning tensorflow

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

machine-learning ×1

python ×1

tensorflow ×1