wang_tao1111
wang_tao1111

Reputation: 21

AttributeError: 'module' object has no attribute 'set_random_seed'

I got the error which is AttributeError: 'module' object has no attribute 'set_random_seed' when I tried to run py-faster-rcnn with my own dataset. Can anyone help me?

Upvotes: 2

Views: 4345

Answers (2)

Maryam Bahrami
Maryam Bahrami

Reputation: 1104

This is probability because you are using Tensorflow 2. So, instead you can simply use

import tensorflow as tf    
tf.random.set_seed(seed)

Upvotes: 3

fafrd
fafrd

Reputation: 1156

I encountered this issue in a different project, and it was because I had installed tensorflow 2 instead of 1. You can work around that by replacing:

import tensorflow as tf

with

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

Upvotes: 0

Related Questions