sjsdfg/dl4j-tutorials

使用cuda进行测试,Cannot add vertex: a vertex with name "outputs" already exists

xiaoyangmoa opened this issue · 2 comments

cuda各个版本为,cpu版本运行正常,但是速度太慢了:
<nd4j.version>1.0.0-beta3</nd4j.version>
<dl4j.version>1.0.0-beta3</dl4j.version>
<datavec.version>1.0.0-beta3</datavec.version>
<arbiter.version>1.0.0-beta3</arbiter.version>
<rl4j.version>1.0.0-beta3</rl4j.version>

运行报错为:
java.lang.IllegalStateException: Cannot add vertex: a vertex with name "outputs" already exists
at org.nd4j.base.Preconditions.throwStateEx(Preconditions.java:641)
at org.nd4j.base.Preconditions.checkState(Preconditions.java:304)
at org.deeplearning4j.nn.conf.ComputationGraphConfiguration$GraphBuilder.addVertex(ComputationGraphConfiguration.java:924)
at org.deeplearning4j.nn.conf.ComputationGraphConfiguration$GraphBuilder.addLayer(ComputationGraphConfiguration.java:788)
at org.deeplearning4j.nn.transferlearning.TransferLearning$GraphBuilder.addLayer(TransferLearning.java:817)
at App.train(App.java:143)
at App.main(App.java:77)

RedBloodCellDetection 对应这个文件里面的 outputs 的层出错,修改了会出现其它错误

问题无法复现
请自己检查配置

o.RedBloodCellDetection - Load data...
o.RedBloodCellDetection - Build model...
o.d.z.ZooModel - Using cached model at C:\Users\73677\.deeplearning4j\models\tinyyolo\tiny-yolo-voc_dl4j_inference.v2.zip
o.d.z.ZooModel - Verifying download...
o.d.z.ZooModel - Checksum local is 1256226465, expecting 1256226465
o.n.l.f.Nd4jBackend - Loaded [JCublasBackend] backend
o.n.n.NativeOpsHolder - Number of threads used for NativeOps: 32
o.n.n.Nd4jBlas - Number of threads used for BLAS: 0
o.n.l.a.o.e.DefaultOpExecutioner - Backend used: [CUDA]; OS: [Windows 10]
o.n.l.a.o.e.DefaultOpExecutioner - Cores: [8]; Memory: [3.5GB];
o.n.l.a.o.e.DefaultOpExecutioner - Blas vendor: [CUBLAS]
o.n.l.j.o.e.CudaExecutioner - Device Name: [GeForce GTX 1050 Ti]; CC: [6.1]; Total/free memory: [4294967296]
o.d.n.g.ComputationGraph - Starting ComputationGraph with WorkspaceModes set to [training: NONE; inference: SEPARATE], cacheMode set to [NONE]

==========================================================================================================================================================================================================================================================
VertexName (VertexType)                 nIn,nOut  TotalParams ParamsShape                             Vertex Inputs                 InputShape                                                                 OutputShape                                                                
==========================================================================================================================================================================================================================================================
input_1 (InputVertex)                   -,-       -           -                                       -                             -                                                                          -                                                                          
conv2d_1 (ConvolutionLayer)             3,16      432         W:{16,3,3,3}                            [input_1]                     InputTypeConvolutional(h=416,w=416,c=3)                                    InputTypeConvolutional(h=416,w=416,c=16)                                   
batch_normalization_1 (BatchNormalization)16,16     64          gamma:{1,16}, beta:{1,16}, mean:{1,16}, var:{1,16}[conv2d_1]                    InputTypeConvolutional(h=416,w=416,c=16)                                   InputTypeConvolutional(h=416,w=416,c=16)                                   
leaky_re_lu_1 (ActivationLayer)         -,-       0           -                                       [batch_normalization_1]       InputTypeConvolutional(h=416,w=416,c=16)                                   InputTypeConvolutional(h=416,w=416,c=16)                                   
max_pooling2d_1 (SubsamplingLayer)      -,-       0           -                                       [leaky_re_lu_1]               InputTypeConvolutional(h=416,w=416,c=16)                                   InputTypeConvolutional(h=208,w=208,c=16)                                   
conv2d_2 (ConvolutionLayer)             16,32     4608        W:{32,16,3,3}                           [max_pooling2d_1]             InputTypeConvolutional(h=208,w=208,c=16)                                   InputTypeConvolutional(h=208,w=208,c=32)                                   
batch_normalization_2 (BatchNormalization)32,32     128         gamma:{1,32}, beta:{1,32}, mean:{1,32}, var:{1,32}[conv2d_2]                    InputTypeConvolutional(h=208,w=208,c=32)                                   InputTypeConvolutional(h=208,w=208,c=32)                                   
leaky_re_lu_2 (ActivationLayer)         -,-       0           -                                       [batch_normalization_2]       InputTypeConvolutional(h=208,w=208,c=32)                                   InputTypeConvolutional(h=208,w=208,c=32)                                   
max_pooling2d_2 (SubsamplingLayer)      -,-       0           -                                       [leaky_re_lu_2]               InputTypeConvolutional(h=208,w=208,c=32)                                   InputTypeConvolutional(h=104,w=104,c=32)                                   
conv2d_3 (ConvolutionLayer)             32,64     18432       W:{64,32,3,3}                           [max_pooling2d_2]             InputTypeConvolutional(h=104,w=104,c=32)                                   InputTypeConvolutional(h=104,w=104,c=64)                                   
batch_normalization_3 (BatchNormalization)64,64     256         gamma:{1,64}, beta:{1,64}, mean:{1,64}, var:{1,64}[conv2d_3]                    InputTypeConvolutional(h=104,w=104,c=64)                                   InputTypeConvolutional(h=104,w=104,c=64)                                   
leaky_re_lu_3 (ActivationLayer)         -,-       0           -                                       [batch_normalization_3]       InputTypeConvolutional(h=104,w=104,c=64)                                   InputTypeConvolutional(h=104,w=104,c=64)                                   
max_pooling2d_3 (SubsamplingLayer)      -,-       0           -                                       [leaky_re_lu_3]               InputTypeConvolutional(h=104,w=104,c=64)                                   InputTypeConvolutional(h=52,w=52,c=64)                                     
conv2d_4 (ConvolutionLayer)             64,128    73728       W:{128,64,3,3}                          [max_pooling2d_3]             InputTypeConvolutional(h=52,w=52,c=64)                                     InputTypeConvolutional(h=52,w=52,c=128)                                    
batch_normalization_4 (BatchNormalization)128,128   512         gamma:{1,128}, beta:{1,128}, mean:{1,128}, var:{1,128}[conv2d_4]                    InputTypeConvolutional(h=52,w=52,c=128)                                    InputTypeConvolutional(h=52,w=52,c=128)                                    
leaky_re_lu_4 (ActivationLayer)         -,-       0           -                                       [batch_normalization_4]       InputTypeConvolutional(h=52,w=52,c=128)                                    InputTypeConvolutional(h=52,w=52,c=128)                                    
max_pooling2d_4 (SubsamplingLayer)      -,-       0           -                                       [leaky_re_lu_4]               InputTypeConvolutional(h=52,w=52,c=128)                                    InputTypeConvolutional(h=26,w=26,c=128)                                    
conv2d_5 (ConvolutionLayer)             128,256   294912      W:{256,128,3,3}                         [max_pooling2d_4]             InputTypeConvolutional(h=26,w=26,c=128)                                    InputTypeConvolutional(h=26,w=26,c=256)                                    
batch_normalization_5 (BatchNormalization)256,256   1024        gamma:{1,256}, beta:{1,256}, mean:{1,256}, var:{1,256}[conv2d_5]                    InputTypeConvolutional(h=26,w=26,c=256)                                    InputTypeConvolutional(h=26,w=26,c=256)                                    
leaky_re_lu_5 (ActivationLayer)         -,-       0           -                                       [batch_normalization_5]       InputTypeConvolutional(h=26,w=26,c=256)                                    InputTypeConvolutional(h=26,w=26,c=256)                                    
max_pooling2d_5 (SubsamplingLayer)      -,-       0           -                                       [leaky_re_lu_5]               InputTypeConvolutional(h=26,w=26,c=256)                                    InputTypeConvolutional(h=13,w=13,c=256)                                    
conv2d_6 (ConvolutionLayer)             256,512   1179648     W:{512,256,3,3}                         [max_pooling2d_5]             InputTypeConvolutional(h=13,w=13,c=256)                                    InputTypeConvolutional(h=13,w=13,c=512)                                    
batch_normalization_6 (BatchNormalization)512,512   2048        gamma:{1,512}, beta:{1,512}, mean:{1,512}, var:{1,512}[conv2d_6]                    InputTypeConvolutional(h=13,w=13,c=512)                                    InputTypeConvolutional(h=13,w=13,c=512)                                    
leaky_re_lu_6 (ActivationLayer)         -,-       0           -                                       [batch_normalization_6]       InputTypeConvolutional(h=13,w=13,c=512)                                    InputTypeConvolutional(h=13,w=13,c=512)                                    
max_pooling2d_6 (SubsamplingLayer)      -,-       0           -                                       [leaky_re_lu_6]               InputTypeConvolutional(h=13,w=13,c=512)                                    InputTypeConvolutional(h=13,w=13,c=512)                                    
conv2d_7 (ConvolutionLayer)             512,1024  4718592     W:{1024,512,3,3}                        [max_pooling2d_6]             InputTypeConvolutional(h=13,w=13,c=512)                                    InputTypeConvolutional(h=13,w=13,c=1024)                                   
batch_normalization_7 (BatchNormalization)1024,1024 4096        gamma:{1,1024}, beta:{1,1024}, mean:{1,1024}, var:{1,1024}[conv2d_7]                    InputTypeConvolutional(h=13,w=13,c=1024)                                   InputTypeConvolutional(h=13,w=13,c=1024)                                   
leaky_re_lu_7 (ActivationLayer)         -,-       0           -                                       [batch_normalization_7]       InputTypeConvolutional(h=13,w=13,c=1024)                                   InputTypeConvolutional(h=13,w=13,c=1024)                                   
conv2d_8 (ConvolutionLayer)             1024,1024 9437184     W:{1024,1024,3,3}                       [leaky_re_lu_7]               InputTypeConvolutional(h=13,w=13,c=1024)                                   InputTypeConvolutional(h=13,w=13,c=1024)                                   
batch_normalization_8 (BatchNormalization)1024,1024 4096        gamma:{1,1024}, beta:{1,1024}, mean:{1,1024}, var:{1,1024}[conv2d_8]                    InputTypeConvolutional(h=13,w=13,c=1024)                                   InputTypeConvolutional(h=13,w=13,c=1024)                                   
leaky_re_lu_8 (ActivationLayer)         -,-       0           -                                       [batch_normalization_8]       InputTypeConvolutional(h=13,w=13,c=1024)                                   InputTypeConvolutional(h=13,w=13,c=1024)                                   
convolution2d_9 (ConvolutionLayer)      1024,30   30720       W:{30,1024,1,1}                         [leaky_re_lu_8]               InputTypeConvolutional(h=13,w=13,c=1024)                                   InputTypeConvolutional(h=13,w=13,c=30)                                     
outputs (Yolo2OutputLayer)              -,-       0           -                                       [convolution2d_9]             InputTypeConvolutional(h=13,w=13,c=30)                                     InputTypeConvolutional(h=13,w=13,c=30)                                     
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
            Total Parameters:  15770480
        Trainable Parameters:  15770480
           Frozen Parameters:  0
==========================================================================================================================================================================================================================================================

o.RedBloodCellDetection - Train model...
o.d.o.l.ScoreIterationListener - Score at iteration 0 is 144.8436877360403
o.d.o.l.ScoreIterationListener - Score at iteration 1 is 136.6377426532769
o.d.o.l.ScoreIterationListener - Score at iteration 2 is 146.40208036328607
o.d.o.l.ScoreIterationListener - Score at iteration 3 is 140.99282526824803
o.d.o.l.ScoreIterationListener - Score at iteration 4 is 144.56626546857055
o.d.o.l.ScoreIterationListener - Score at iteration 5 is 147.27808616722498