DigiPathAI icon indicating copy to clipboard operation
DigiPathAI copied to clipboard

module 'tensorflow' has no attribute 'set_random_seed'

Open bushra-tayyaba opened this issue 3 years ago • 4 comments

This error " module 'tensorflow' has no attribute 'set_random_seed'" occurs after running the following code :

from DigiPathAI.Segmentation import getSegmentation

prediction = getSegmentation(img_path, patch_size = 256, stride_size = 128, batch_size = 32, quick = True, tta_list = None, crf = False, save_path = None, status = None)

bushra-tayyaba avatar Nov 05 '21 09:11 bushra-tayyaba

I'm having the same issue, which arises because tensorflow version 2 has a different random seed function. It seems like it should be an easy fix but I haven't got it working yet

scjjb avatar Dec 06 '21 16:12 scjjb

@bushra-tayyaba As @scjjb says, DigiPathAI was built with Tensorflow 1.

@scjjb Does modifying it work?

haranrk avatar Feb 24 '22 11:02 haranrk

I never managed to resolve the issue

scjjb avatar Feb 24 '22 11:02 scjjb

just replacing it with tf.random.set_seed(seed) should solve this issue.

codeskings avatar Jan 13 '23 21:01 codeskings