Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion capslayer/core/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@

import numpy as np
import capslayer as cl
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf


def routing(votes,
Expand Down
6 changes: 5 additions & 1 deletion capslayer/core/transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
from __future__ import division
from __future__ import print_function

import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf
import capslayer as cl


Expand Down
6 changes: 5 additions & 1 deletion capslayer/data/datasets/cifar10/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
from __future__ import print_function

import os
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf

from capslayer.data.datasets.cifar10.writer import tfrecord_runner

Expand Down
6 changes: 5 additions & 1 deletion capslayer/data/datasets/cifar10/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@

import os
import numpy as np
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf
from tensorflow.python.keras.utils.data_utils import get_file
from tensorflow.python.keras.datasets.cifar import load_batch

Expand Down
6 changes: 5 additions & 1 deletion capslayer/data/datasets/cifar100/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
from __future__ import print_function

import os
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf

from capslayer.data.datasets.cifar100.writer import tfrecord_runner

Expand Down
6 changes: 5 additions & 1 deletion capslayer/data/datasets/cifar100/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@

import os
import numpy as np
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf
from tensorflow.python.keras.utils.data_utils import get_file
from tensorflow.python.keras.datasets.cifar import load_batch

Expand Down
6 changes: 5 additions & 1 deletion capslayer/data/datasets/fashion_mnist/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
from __future__ import print_function

import os
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf
from capslayer.data.utils.download_utils import maybe_download_and_extract
from capslayer.data.datasets.fashion_mnist.writer import tfrecord_runner

Expand Down
6 changes: 5 additions & 1 deletion capslayer/data/datasets/fashion_mnist/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@

import os
import numpy as np
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf

from capslayer.data.utils.TFRecordHelper import int64_feature, bytes_feature

Expand Down
6 changes: 5 additions & 1 deletion capslayer/data/datasets/mnist/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
from __future__ import print_function

import os
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf
from capslayer.data.utils.download_utils import maybe_download_and_extract
from capslayer.data.datasets.mnist.writer import tfrecord_runner

Expand Down
6 changes: 5 additions & 1 deletion capslayer/data/datasets/mnist/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@

import os
import numpy as np
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf

from capslayer.data.utils.TFRecordHelper import int64_feature, bytes_feature

Expand Down
6 changes: 5 additions & 1 deletion capslayer/data/utils/TFRecordHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
from __future__ import division
from __future__ import print_function

import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf


def int64_feature(value):
Expand Down
6 changes: 5 additions & 1 deletion capslayer/layers/convolutional.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
from __future__ import print_function

import capslayer as cl
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf

from capslayer.core import routing
from capslayer.core import transforming
Expand Down
6 changes: 5 additions & 1 deletion capslayer/layers/convolutional_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@

import numpy as np
import capslayer as cl
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf


def testConv2d():
Expand Down
6 changes: 5 additions & 1 deletion capslayer/layers/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@

import numpy as np
import capslayer as cl
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf

from capslayer.core import routing
from capslayer.core import transforming
Expand Down
6 changes: 5 additions & 1 deletion capslayer/ops/losses/losses.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
from __future__ import print_function

import capslayer as cl
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf


def spread_loss(labels, logits, margin, regularizer=None):
Expand Down
6 changes: 5 additions & 1 deletion capslayer/ops/math_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@

import numpy as np
import capslayer as cl
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf


def matmul(a, b,
Expand Down
6 changes: 5 additions & 1 deletion capslayer/ops/nn_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
from __future__ import division
from __future__ import print_function

import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf
import capslayer as cl
import numpy as np

Expand Down
6 changes: 5 additions & 1 deletion capslayer/ops/nn_ops_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
from __future__ import print_function

import numpy as np
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf

from nn_ops import space_to_batch_nd_v1
from nn_ops import space_to_batch_nd
Expand Down
6 changes: 5 additions & 1 deletion capslayer/ops/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
from __future__ import print_function

import capslayer as cl
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf


def squash(inputs, axis=-2, ord="euclidean", name=None):
Expand Down
6 changes: 5 additions & 1 deletion capslayer/summary/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
from __future__ import division
from __future__ import print_function

import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf


def image(name,
Expand Down
6 changes: 5 additions & 1 deletion models/baseline.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@

import numpy as np
import capslayer as cl
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf

from config import cfg

Expand Down
6 changes: 5 additions & 1 deletion models/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import os
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf

flags = tf.app.flags

Expand Down
6 changes: 5 additions & 1 deletion models/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
import os
import time
import numpy as np
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf
from tensorflow.python.client import timeline
from importlib import import_module
from capslayer.plotlib import plot_activation
Expand Down
6 changes: 5 additions & 1 deletion models/matrixCapsNet.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@

import numpy as np
import capslayer as cl
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf

from config import cfg

Expand Down
6 changes: 5 additions & 1 deletion models/vectorCapsNet.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@

import numpy as np
import capslayer as cl
import tensorflow as tf
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as tf

from config import cfg

Expand Down