mexchy1000/CellDART

NameError: name 'enable_dann' is not defined

Closed this issue · 1 comments

Jupyter Notebook를 실행시키는 도중에 다음 셀에서 오류가 출력됩니다. 무슨 문제일까요?

embs, clssmodel = da_cellfraction.train(sc_mix_s, lab_mix, mat_sp_s, 
                                 alpha=1, alpha_lr=5, emb_dim = 64, batch_size = 512,
                                 n_iterations = 2000,
                                  initial_train=True,
                                  initial_train_epochs=10)
Epoch 1/10
5000/5000 [==============================] - 0s 21us/step - loss: 1.2231 - mean_absolute_error: 0.0392
Epoch 2/10
5000/5000 [==============================] - 0s 16us/step - loss: 0.6851 - mean_absolute_error: 0.0273
Epoch 3/10
5000/5000 [==============================] - 0s 17us/step - loss: 0.5768 - mean_absolute_error: 0.0242
Epoch 4/10
5000/5000 [==============================] - 0s 17us/step - loss: 0.5128 - mean_absolute_error: 0.0223
Epoch 5/10
5000/5000 [==============================] - 0s 17us/step - loss: 0.4664 - mean_absolute_error: 0.0208
Epoch 6/10
5000/5000 [==============================] - 0s 19us/step - loss: 0.4304 - mean_absolute_error: 0.0198
Epoch 7/10
5000/5000 [==============================] - 0s 17us/step - loss: 0.4017 - mean_absolute_error: 0.0190
Epoch 8/10
5000/5000 [==============================] - 0s 19us/step - loss: 0.3743 - mean_absolute_error: 0.0181
Epoch 9/10
5000/5000 [==============================] - 0s 20us/step - loss: 0.3529 - mean_absolute_error: 0.0175
Epoch 10/10
5000/5000 [==============================] - 0s 19us/step - loss: 0.3337 - mean_absolute_error: 0.0170
initial_train_done
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
 in 
      3                                  n_iterations = 2000,
      4                                   initial_train=True,
----> 5                                   initial_train_epochs=10)

~/Project/st/CellDART/da_cellfraction.py in train(Xs, ys, Xt, yt, emb_dim, batch_size, enable_da, n_iterations, alpha, alpha_lr, initial_train, initial_train_epochs)
    109                 adv_weights.append(layer.get_weights())
    110 
--> 111         if(enable_dann):
    112             # note - even though we save and append weights, the batchnorms moving means and variances
    113             # are not saved throught this mechanism

NameError: name 'enable_dann' is not defined


There is an error in a variable name. Thanks.
codes are now updated.