hanzhanggit / StackGAN-Pytorch

MIT License
491 stars 146 forks source link

ImportError: cannot import name 'FileWriter' from 'tensorboard' #16

Closed hkuyam008 closed 6 years ago

hkuyam008 commented 6 years ago

I am getting the following error trace while trying to run the Stage I of training using coco dataset

Looks like tensorboard V 1.10.0 (which is what I have installed in my virtual env does not have a class called FileWriter???). My Pycharm IDE is also complaining about the same thing

Traceback (most recent call last): File "C:/PyCharmProjects/StackGAN-Pytorch/code/main.py", line 19, in from trainer import GANTrainer File "C:\PyCharmProjects\StackGAN-Pytorch\code\trainer.py", line 24, in from tensorboard import FileWriter ImportError: cannot import name 'FileWriter' from 'tensorboard' (C:\PythonVEnvs\StackGANPyTorch\lib\site-packages\tensorboard__init__.py)

Process finished with exit code 1

AnwarUllahKhan commented 6 years ago

@hkuyam008 I am facing the same problem did you solve that?

hkuyam008 commented 6 years ago

@AnwarUllahKhan I ended up uninstalling tensorboard and using tensorflow instead and then you have to change the import to " from tensorflow.summary import FileWriter"

While I very much appreciate the effort these guys have put in to provide a RI of Stack-GAN, 1 glaring drawback of their documentation / wiki is the absence of any kind of software version, OS specifics and platform on which they tested this program.....and "version mismatch" is a nightmarish problem of the software world, which unfortunately no one has found an elegant solution to.....till date.

AnwarUllahKhan commented 6 years ago

@hkuyam008 I solved the problem by installing tensorboardX....and also change that from tensorboardX import FileWriter, you can also try this

hkuyam008 commented 6 years ago

@AnwarUllahKhan Thanks for the solution