Code Monkey home page Code Monkey logo

Comments (8)

shekkizh avatar shekkizh commented on August 17, 2024

The error is unclear. Can you add more detail to the issue?
It seems you were able to train and the error occurred after some time?! Possible error with the annotation file?

from fcn.tensorflow.

Yaredoh avatar Yaredoh commented on August 17, 2024
Setting up summary op...
Setting up image reader...
Found pickle file!
50
15
Setting up dataset reader
Initializing Batch Dataset Reader...
{'resize_size': 224, 'resize': True}
(50, 224, 224, 3)
(50, 224, 224, 1)
Initializing Batch Dataset Reader...
{'resize_size': 224, 'resize': True}
(15, 224, 224, 3)
(15, 224, 224, 1)
Setting up Saver...
Traceback (most recent call last):

  File "<ipython-input-1-12b2e3f5c7e5>", line 1, in <module>
    runfile('C:/Users/Yared/Desktop/Project/FCN.py', wdir='C:/Users/Yared/Desktop/Project')

  File "C:\Users\Yared\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile
    execfile(filename, namespace)

  File "C:\Users\Yared\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "C:/Users/Yared/Desktop/Project/FCN.py", line 227, in <module>
    tf.app.run()

  File "C:\Users\Yared\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 44, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))

  File "C:/Users/Yared/Desktop/Project/FCN.py", line 198, in main
    sess.run(train_op, feed_dict=feed_dict)

  File "C:\Users\Yared\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 767, in run
    run_metadata_ptr)

  File "C:\Users\Yared\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 965, in _run
    feed_dict_string, options, run_metadata)

  File "C:\Users\Yared\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1015, in _do_run
    target_list, options, run_metadata)

  File "C:\Users\Yared\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1035, in _do_call
    raise type(e)(node_def, op, message)



InvalidArgumentError: Received a label value of 250 which is outside the valid range of [0, 151).  Label values: 66 57 54 59 60 59 54 65 111 133 133 144 150 154 160 166 165 159 155 135 44 25 15 13 13 12 13 13 14 16 16 30 50 61 70 72 71 77 87 102 110 112 102......................42 76 103 105 110 108 62 28
	 [[Node: entropy/entropy = SparseSoftmaxCrossEntropyWithLogits[T=DT_FLOAT, Tlabels=DT_INT32, _device="/job:localhost/replica:0/task:0/cpu:0"](entropy/Reshape, entropy/Reshape_1)]]

Thanks for your help.

from fcn.tensorflow.

shekkizh avatar shekkizh commented on August 17, 2024

The error is pretty clear - your annotation file has value 250 when the NUM_OF_CLASSES range from [0, 151). If this is your custom dataset try processing your annotation file to have values within range.

from fcn.tensorflow.

Yaredoh avatar Yaredoh commented on August 17, 2024

Thanks, for your help. What do you mean try processing your annotation file to have values within the range? How can I do that? I was trying to assign default label if it is out of range. How can I control it the label to not be out of the range? Thanks for your help.

from fcn.tensorflow.

Yaredoh avatar Yaredoh commented on August 17, 2024

Thanks. I know the error. initially i trained the network with 151 number of classes and when i try to change the number of classes to 250 and train it again gave me the error. it was holds the initial number of classes value. I cloned the script again as a new and works with 250 number of class perfectly.

from fcn.tensorflow.

matvaibhav avatar matvaibhav commented on August 17, 2024

@Yaredoh @shekkizh Sorry to bother you but could you please tell me if my number of classes is 2, what all changes need to be done? While training I set NUM_OF_CLASSES as 3. Which one is the annotation file? What changes have to be made in it? Sorry if the question is stupid but I am new to tensorflow. Thanks in advance.

from fcn.tensorflow.

xcnie avatar xcnie commented on August 17, 2024

@Yaredoh @shekkizh Sorry to bother you but could you please tell me if my number of classes is 2, what all changes need to be done? While training I set NUM_OF_CLASSES as 3. Which one is the annotation file? What changes have to be made in it? Sorry if the question is stupid but I am new to tensorflow. Thanks in advance.

hello,I meet the same question, do you solve it?

from fcn.tensorflow.

BaoanhTrinh avatar BaoanhTrinh commented on August 17, 2024

@matvaibhav @xcnie and anyone else: if you have a grayscale image, NUM_OF_CLASSES should be 256. It means your image has pixels' value from 0 to 255

from fcn.tensorflow.

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.