Giter Club home page Giter Club logo

Comments (3)

brightmart avatar brightmart commented on May 20, 2024
  1. first you should create a folder name: "cache_vocabulary_label_pik".
  2. cnn2_word_voabulary.pik will be created under a function create_voabulary at data_util_zhihu.py. you can see from the code that it will be created if it is not exist; otherwise, it will be used.

from text_classification.

lydemo avatar lydemo commented on May 20, 2024

Then another error occurs:
Traceback (most recent call last):
File "E:/test/text_classification-master/text_classification-master/a02_TextCNN/p7_TextCNN_train.py", line 197, in
tf.app.run()
File "E:\Anaconda\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "E:/test/text_classification-master/text_classification-master/a02_TextCNN/p7_TextCNN_train.py", line 48, in main
vocabulary_word2index, vocabulary_index2word = create_voabulary(word2vec_model_path=FLAGS.word2vec_model_path,name_scope="cnn2") #simple='simple'
File "E:\test\text_classification-master\text_classification-master\aa1_data_util\data_util_zhihu.py", line 18, in create_voabulary
vocabulary_word2index, vocabulary_index2word=pickle.load(data_f)
TypeError: a bytes-like object is required, not 'str'
cache_path: cache_vocabulary_label_pik/cnn2_word_voabulary.pik file_exists: True

I know it's caused by pickle, but how to fix the error?

from text_classification.

brightmart avatar brightmart commented on May 20, 2024

you may paas file object to pikle.load, not a file name or path.

from text_classification.

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.