mirror of
				https://github.com/qurator-spk/eynollah.git
				synced 2025-11-03 19:24:13 +01:00 
			
		
		
		
	set_memory_growth to all GPU devices alike
This commit is contained in:
		
							parent
							
								
									cb5ffaee14
								
							
						
					
					
						commit
						529f2c0e19
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -650,7 +650,8 @@ class Eynollah:
 | 
				
			||||||
        #session = tf.compat.v1.Session(config=tf.compat.v1.ConfigProto(gpu_options=gpu_options))
 | 
					        #session = tf.compat.v1.Session(config=tf.compat.v1.ConfigProto(gpu_options=gpu_options))
 | 
				
			||||||
        physical_devices = tf.config.list_physical_devices('GPU')
 | 
					        physical_devices = tf.config.list_physical_devices('GPU')
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            tf.config.experimental.set_memory_growth(physical_devices[0], True)
 | 
					            for device in physical_devices:
 | 
				
			||||||
 | 
					                tf.config.experimental.set_memory_growth(device, True)
 | 
				
			||||||
        except:
 | 
					        except:
 | 
				
			||||||
            self.logger.warning("no GPU device available")
 | 
					            self.logger.warning("no GPU device available")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue