Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google colaboratory 当重新连接到Colaboratory时,我的计算机崩溃了_Google Colaboratory - Fatal编程技术网

Google colaboratory 当重新连接到Colaboratory时,我的计算机崩溃了

Google colaboratory 当重新连接到Colaboratory时,我的计算机崩溃了,google-colaboratory,Google Colaboratory,我试图在Colaboratory上运行我的深度学习代码,但每次我运行到26%的进度时,它就会自动断开连接,当我重新连接到服务器时,计算机就会冻结。我的培训循环如下所示: from tqdm import tqdm_notebook import matplotlib from PIL import Image dev_gen_costs = [] config = tf.ConfigProto(device_count={'gpu':0}) config.gpu_options.allow_gr

我试图在Colaboratory上运行我的深度学习代码,但每次我运行到26%的进度时,它就会自动断开连接,当我重新连接到服务器时,计算机就会冻结。我的培训循环如下所示:

from tqdm import tqdm_notebook
import matplotlib
from PIL import Image
dev_gen_costs = []
config = tf.ConfigProto(device_count={'gpu':0})
config.gpu_options.allow_growth = True
sess = tf.InteractiveSession(config = config)
sess.run(tf.global_variables_initializer())
for iteration in tqdm_notebook(range(ITERS), desc='generate and discriminate'):
    time.sleep(0.01)
    start_time = time.time()
    num = iteration%(train_vis.shape[0]//BATCH_SIZE)
    data_IR = train_ir[num*BATCH_SIZE:(num+1)*BATCH_SIZE,:,:]
    data_VI = train_vis[num*BATCH_SIZE:(num+1)*BATCH_SIZE,:,:]
    data_IR = np.expand_dims(data_IR,axis = -1)
    data_VI = np.expand_dims(data_VI,axis = -1)
    feed_dict={real_data1_int:data_IR, real_data2_int:data_VI}
    # Train generator
    _ = sess.run([gen_train_op],feed_dict)
    # Train critic
    for i in range(CRITIC_ITERS):
        _costs, _ = sess.run([[disc_cost ,gen_cost],disc_train_op] ,feed_dict)
        dev_gen_costs.append(_costs)#loss

崩溃是由于正在运行的代码中的某些错误造成的

崩溃是由于您正在运行的代码中的某些错误造成的

事实上,相同的代码在我的计算机上运行没有任何问题,所以你能告诉我我的代码哪里出错了吗?当我转到colab时,有很多事情需要检查。Tensorflow版本,依赖模块,代码中给出的路径。一步一步地运行,看看问题到底发生在哪里。使用try-except捕捉错误,这样就不会使记事本崩溃事实上,相同的代码在我的计算机上运行时没有任何问题,所以你能告诉我我的代码哪里出错了吗?当转到colab时,有很多事情要检查。Tensorflow版本,依赖模块,代码中给出的路径。一步一步地运行,看看问题到底发生在哪里。使用try-except捕捉错误,这样不会使笔记本崩溃