improved-gan icon indicating copy to clipboard operation
improved-gan copied to clipboard

Tab Error

Open marcinic opened this issue 6 years ago • 3 comments

In [1]: from model import DCGAN Traceback (most recent call last):

File "/home/marcinic/miniconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2910, in run_code exec(code_obj, self.user_global_ns, self.user_ns)

File "", line 1, in from model import DCGAN

File "/home/marcinic/hdd/projects/reinforcement/retro/improved-gan/imagenet/model.py", line 47 self.out_init_b = out_init_b ^ TabError: inconsistent use of tabs and spaces in indentation

A couple lines in imagenet/model.py use tabs instead of spaces

marcinic avatar Jun 07 '18 17:06 marcinic

@marcinic did you solve this error? If yes then how?

mtoseef99 avatar Jul 11 '19 05:07 mtoseef99

@Toseef99 From the looks of it, this repo was written in Python 2, not Python 3; you will fix this and many other errors trying to run this repository if you switch to Python 2. (For the curious, Python 2 allows mixed tabs and spaces (treating a tab as 8 spaces), whereas Python 3 simply disallows mixing tabs and spaces.)

evhub avatar Jul 11 '19 05:07 evhub

@evhub could you please tell me a specific version of Python 2?

  • and for latest versions of Python i.e. 3.6.x or 3.7.x what is the best way to overcome this tab error?

mtoseef99 avatar Jul 11 '19 13:07 mtoseef99