Giter VIP home page Giter VIP logo

Comments (5)

pronoym99 avatar pronoym99 commented on May 23, 2024

I am also getting the same error. I have now converted the entire repository to Python 3.8 using the 2to3.8 command available in Unix systems. However, I continue to get the same error.

from passgan.

morpheuslord avatar morpheuslord commented on May 23, 2024

same i tried using 2.7 and also 3.11 and 3.10 but same error

from passgan.

Gurkinator1 avatar Gurkinator1 commented on May 23, 2024

this is relatively easy to fix. after some googling I found out that you can load python2 pickles in python3 by specifying the encoding:

line 73-76 in sample.py

 with open(os.path.join(args.input_dir, 'charmap.pickle'), 'rb') as f:
     charmap = pickle.load(f, encoding="latin1")
 
 with open(os.path.join(args.input_dir, 'inv_charmap.pickle'), 'rb') as f:
     inv_charmap = pickle.load(f, encoding="latin1")

I just changed those lines + added brackets to all print statements and that was it. I get a different error, TypeError: Variable is unhashable. but thats a seperate issue

from passgan.

RarMane avatar RarMane commented on May 23, 2024

this is relatively easy to fix. after some googling I found out that you can load python2 pickles in python3 by specifying the encoding:

line 73-76 in sample.py

 with open(os.path.join(args.input_dir, 'charmap.pickle'), 'rb') as f:
     charmap = pickle.load(f, encoding="latin1")
 
 with open(os.path.join(args.input_dir, 'inv_charmap.pickle'), 'rb') as f:
     inv_charmap = pickle.load(f, encoding="latin1")

I just changed those lines + added brackets to all print statements and that was it. I get a different error, TypeError: Variable is unhashable. but thats a seperate issue

Did you solved problem with "TypeError: Variable is unhashable."?

from passgan.

Gurkinator1 avatar Gurkinator1 commented on May 23, 2024

Did you solved problem with "TypeError: Variable is unhashable."?

As far as I know it's caused by newer tensorflow versions. I "fixed" it by changing lines 28-30 of file PassGAN/tflib/__init__.py

- result = _params[name]
+ result = _params[name].ref()
i = 0
- while result in _param_aliases:
+ while result in _param_aliases.keys(): #not sure if this is required

However now tensorflow has problems transforming the value into a tensor. in File "PassGAN/tflib/ops/linear.py", line 133, in Linear: ValueError: Attempt to convert a value (<Reference wrapping <tf.Variable 'Generator.Input/Generator.Input.W:0' shape=(128, 1280) dtype=float32, numpy= array([...], dtype=float32)>>) with an unsupported type (<class 'tensorflow.python.util.object_identity.Reference'>) to a Tensor.

I dont know enough about tensorflow to fix this. I tried using tf.identity to manually dereference the value, but that didnt work either. This project uses both python2 and outdated tensorflow versions. I dont know if its even worth the trouble
¯\(ツ)

from passgan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.