dhruvramani / C2AE-Multilabel-Classification

Tensorflow implementation for the paper 'Learning Deep Latent Spaces for Multi-Label Classfications' in AAAI 2017
101 stars 24 forks source link

AttributeError: 'Network' object has no attribute 'patk' #2

Closed Yong-DAI closed 6 years ago

Yong-DAI commented 6 years ago

=> Training Model Traceback (most recent call last):

File "", line 1, in runfile('/home/dy/dy-doc/C2AE-Multilabel-Classification-master/model/src/main.py', wdir='/home/dy/dy-doc/C2AE-Multilabel-Classification-master/model/src')

File "/home/dy/anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 710, in runfile execfile(filename, namespace)

File "/home/dy/anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 101, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "/home/dy/dy-doc/C2AE-Multilabel-Classification-master/model/src/main.py", line 204, in main() # Phew!

File "/home/dy/dy-doc/C2AE-Multilabel-Classification-master/model/src/main.py", line 189, in main loss_dict = train_model(config)

File "/home/dy/dy-doc/C2AE-Multilabel-Classification-master/model/src/main.py", line 180, in train_model model, sess = init_model(config)

File "/home/dy/dy-doc/C2AE-Multilabel-Classification-master/model/src/main.py", line 163, in init_model model = Model(config)

File "/home/dy/dy-doc/C2AE-Multilabel-Classification-master/model/src/main.py", line 26, in init self.patk = self.net.patk(self.y, self.y_pred)

AttributeError: 'Network' object has no attribute 'patk'

it's true that i didn't fint patk function in network.py, do you know how to fix this?

dhruvramani commented 6 years ago

Hey I just checked. That line was useless, and was there because previously I had been using a tensorflow based patk function. I have defined the patk in eval_performance.py and have been using that in rest of the code.

Yong-DAI commented 6 years ago

thanks a lot. so ,when I edit that line to self.patk=patk(self.y,self.y_pred),this mean that I delete "self.net", but when I run this again ,I got another error, in eval_performance.py, line11,it said typeerror,index returned non-int(type nonetype)

Yong-DAI commented 6 years ago

o ,I just comment that line ,now ,it works,thank u,thank u very much

dhruvramani commented 6 years ago

No problem! :)

Yong-DAI commented 6 years ago

ha, when I read the lines in networks.py, I saw the line" #my blood ,my sweat and my tears were also embedded into the embedding", I'm touched , I just want to thank u, thank u for your coding work ,and thank u for your sharing!

dhruvramani commented 6 years ago

Haha, this made my day! Thank you for appreciating. Also, try avoiding usage of loops with TensorFlow, it's a pain. Have a nice day :)

Yong-DAI commented 6 years ago

Hi, I'm a little confused, one thing,could you please tell me about the run.py, because I don't find any other py files that use this run.py, "run" in the "sess.run" in other py files should be a default function included in the tf.session of tensorflow, not this run.py ,right?

dhruvramani commented 6 years ago

Ya, no file is using run.py. And yes, sess.run is from TensorFlow. It's actually an incomplete file, you could run the code through main.py or run.py (with some differences). You can try running it through run.py but I can't guarantee that it will work.