|
381 | 381 | " # This is a one-time operation which ensures the parameters get initialized as\n",
|
382 | 382 | " # we described in the graph: random weights for the matrix, zeros for the\n",
|
383 | 383 | " # biases. \n",
|
384 |
| - " tf.initialize_all_variables().run()\n", |
| 384 | + " tf.global_variables_initializer().run()\n", |
385 | 385 | " print 'Initialized'\n",
|
386 | 386 | " for step in xrange(num_steps):\n",
|
387 | 387 | " # Run the computations. We tell .run() that we want to run the optimizer,\n",
|
|
544 | 544 | "num_steps = 3001\n",
|
545 | 545 | "\n",
|
546 | 546 | "with tf.Session(graph=graph) as session:\n",
|
547 |
| - " tf.initialize_all_variables().run()\n", |
| 547 | + " tf.global_variables_initializer().run()\n", |
548 | 548 | " print \"Initialized\"\n",
|
549 | 549 | " for step in xrange(num_steps):\n",
|
550 | 550 | " # Pick an offset within the training data, which has been randomized.\n",
|
|
589 | 589 | "colab_default_view": {},
|
590 | 590 | "colab_views": {},
|
591 | 591 | "kernelspec": {
|
592 |
| - "display_name": "Python 3", |
| 592 | + "display_name": "Python 2", |
593 | 593 | "language": "python",
|
594 |
| - "name": "python3" |
| 594 | + "name": "python2" |
595 | 595 | },
|
596 | 596 | "language_info": {
|
597 | 597 | "codemirror_mode": {
|
598 | 598 | "name": "ipython",
|
599 |
| - "version": 3 |
| 599 | + "version": 2 |
600 | 600 | },
|
601 | 601 | "file_extension": ".py",
|
602 | 602 | "mimetype": "text/x-python",
|
603 | 603 | "name": "python",
|
604 | 604 | "nbconvert_exporter": "python",
|
605 |
| - "pygments_lexer": "ipython3", |
606 |
| - "version": "3.4.3" |
| 605 | + "pygments_lexer": "ipython2", |
| 606 | + "version": "2.7.12" |
607 | 607 | }
|
608 | 608 | },
|
609 | 609 | "nbformat": 4,
|
|
0 commit comments