Closed hvgazula closed 3 months ago
@spikedoanz Gathering some info here to determine the plan of action- Can you please remind me why did you choose to use the synthseg in nobrainer (which is 2.15) rather than the original synthseg (2.2)? My guess about this error is- it is an artifact of the newer tf version which will take some time to figure out.
CC: @sergeyplis
Also, partially (if not fully 🤷♂️ ) my fault for not (unintentionally) informing you about the limitation of synthseg in nobrainer that it failed with randomise_res=True
.
We decided to use the nobrainer version of SynthSeg because it's faster than the original Synthseg implementation by orders of magnitude (on A40, original synthseg boots in 20 minutes, while the nobrainer version boots in just 7 seconds; and once it starts generating, the nobrainer version is twice as fast)
But, for now we'll try to move back to the original Synthseg where we need randomise_res. Thanks so much for the help Harsha!
Okay. that 20 min vs 7 sec gap is enough to take this up seriously. Please use the old one as a stopgap while I look into this.
In SampleResolution.call(...)
replaced self.min_res_tens = tf.tile(tf.expand_dims(self.min_res_tens, 0), tile_shape)
with self.min_res_tens_tiled = tf.tile(tf.expand_dims(self.min_res_tens, 0), tile_shape)
and replaced every subsequent self.min_res_tens
with self.min_res_tens_tiled
.
Note: In hindsight, it wasn't a good idea to reuse/overwrite a node in the graph, rather creating a new node is desirable.
@spikedoanz I "think" I fixed this issue (without extensive testing). I'd appreciate it if you could test it and let me know if any issues arise.
CC: @sergeyplis
what were you trying to do?
generating a sample brain with synthseg (using default parameters)what did you expect will happen?
generates a sample without raising any errorwhat actually happened?
Can you replicate the behavior? If yes, how?
seegithub.com/nobrainer_training_scripts/1.2.0/scripts/train/synthseg.py