Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
63f5827d
Commit
63f5827d
authored
Jan 07, 2019
by
Taylor Robie
Browse files
remove mock to debug kokoro failures
parent
c49b8b71
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
official/recommendation/data_test.py
official/recommendation/data_test.py
+10
-5
No files found.
official/recommendation/data_test.py
View file @
63f5827d
...
...
@@ -22,7 +22,6 @@ from collections import defaultdict
import
hashlib
import
os
import
mock
import
numpy
as
np
import
scipy.stats
import
tensorflow
as
tf
...
...
@@ -50,12 +49,15 @@ FRESH_RANDOMNESS_MD5 = "63d0dff73c0e5f1048fbdc8c65021e22"
def
mock_download
(
*
args
,
**
kwargs
):
return
# The forkpool used by data producers interacts badly with the threading
# used by TestCase. Without this patch tests will hang, and no amount
# of diligent closing and joining within the producer will prevent it.
@
mock
.
patch
.
object
(
popen_helper
,
"get_forkpool"
,
popen_helper
.
get_fauxpool
)
class
BaseTest
(
tf
.
test
.
TestCase
):
def
setUp
(
self
):
# The forkpool used by data producers interacts badly with the threading
# used by TestCase. Without this patch tests will hang, and no amount
# of diligent closing and joining within the producer will prevent it.
self
.
_get_forkpool
=
popen_helper
.
get_forkpool
popen_helper
.
get_forkpool
=
popen_helper
.
get_fauxpool
self
.
temp_data_dir
=
self
.
get_temp_dir
()
ratings_folder
=
os
.
path
.
join
(
self
.
temp_data_dir
,
DATASET
)
tf
.
gfile
.
MakeDirs
(
ratings_folder
)
...
...
@@ -93,6 +95,9 @@ class BaseTest(tf.test.TestCase):
data_preprocessing
.
DATASET_TO_NUM_USERS_AND_ITEMS
[
DATASET
]
=
(
NUM_USERS
,
NUM_ITEMS
)
def
tearDown
(
self
):
popen_helper
.
get_forkpool
=
self
.
_get_forkpool
def
make_params
(
self
,
train_epochs
=
1
):
return
{
"train_epochs"
:
train_epochs
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment